/** Alias of flexipages() function */
 function flexi_pages($args = array())
 {
     return flexipages($args);
 }
Exemple #2
0
 function flexipages_widget($args, $widget_args = 1)
 {
     //		echo "here";
     extract($args, EXTR_SKIP);
     if (is_numeric($widget_args)) {
         $widget_args = array('number' => $widget_args);
     }
     $widget_args = wp_parse_args($widget_args, array('number' => -1));
     extract($widget_args, EXTR_SKIP);
     $options = get_option('flexipages_widget');
     if (!isset($options[$number])) {
         $options[$number] = flexipages_options_default();
     }
     //		echo "<pre>"; print_r ($options[$number]); echo "</pre>";
     extract($options[$number]);
     $title = apply_filters('widget_title', $options[$number]['title']);
     $include = $exclude = '';
     if (isset($exinclude) && isset($exinclude_values)) {
         if ($exinclude == 'include') {
             $include = $exinclude_values;
         } else {
             $exclude = $exinclude_values;
         }
     }
     if ($show_subpages_check == 'off' || !$show_subpages_check) {
         $depth = 1;
         $show_subpages = '';
     } else {
         if ($show_subpages_check == 'on' && $show_subpages == 0) {
             $show_subpages = 1;
         }
     }
     if ($hierarchy == 'off' || !$hierarchy) {
         $depth = -1;
     }
     if (isset($home_link) && $home_link) {
         $show_home = $home_link;
     } else {
         if ($show_home_check != 'on') {
             $show_home = '';
         } else {
             if ($show_home_check == 'on' && !$show_home) {
                 $show_home = __('Home');
             }
         }
     }
     if ($pagelist = flexipages("echo=0&sort_column={$sort_column}&sort_order={$sort_order}&exclude={$exclude}&include={$include}&show_subpages={$show_subpages}&hierarchy={$hierarchy}&depth={$depth}&show_home={$show_home}&show_date={$show_date}&date_format={$date_format}&dropdown={$dropdown}")) {
         echo $before_widget;
         if ($title && $pagelist) {
             echo $before_title . $title . $after_title . "\n";
         }
         /* 	$before_pagelist and $after_pagelist are widget arguments that 
         				can be defined in the functions.php of your theme.
         				These arguments can be used, for example, if you want to enclose
         				the	pagelist within a <div>.
         			*/
         if (isset($before_pagelist) && isset($after_pagelist)) {
             echo $before_pagelist . $pagelist . $after_pagelist . "\n";
         } else {
             echo $pagelist . "\n";
         }
         echo $after_widget;
     }
 }