예제 #1
0
function get_godfather($id, $catfather_array = array())
{
    $generations = get_generations($id, $catfather_array);
    return end($generations);
}
예제 #2
0
 static function list_wf_widgets($regions)
 {
     // v3.84  This gets called by admin.php
     global $post;
     /* // v6.73
     			$godfather = get_godfather($post->ID, Wf_Widget::$catfather_array); // v6.73
     			WF_Debug::stash(array('$godfather' => $godfather));
     			if (!$godfather) {
     				return '';
     			}
     			$generations = get_post_ancestors($post->ID); // why do this bit more than once??
     			
     			array_unshift($generations, $post->ID); // $id followed by all ancestors
     			
     			if(!empty(Wf_Widget::$catfather_array)) {  // v6.73
     				$generations = array($godfather); // precalculated from $catfather_array
     				WF_Debug::stash(array('is_single' => "Yes"));
     			}
     			*/
     $generations = get_generations($post->ID, Wf_Widget::$catfather_array);
     // v6.73
     d('$generations', $generations);
     $widget_list = array();
     // v6.12
     foreach ($regions as $region) {
         $widget_list[$region] = self::get_regional_inheritance($generations, $region);
         // v6.53
     }
     return $widget_list;
     // v4.12 [$region]['current' or 'inherited'] $widget_type,$qstring,$rank,$aboveness
 }