[118] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | function page_block($options)
|
---|
| 4 | {
|
---|
| 5 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 6 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_page_block.html' : trim( $options[1] );
|
---|
[127] | 7 | $sort_column = empty( $options[2] ) ? 'post_title' : $options[2] ;
|
---|
| 8 | $sort_order = empty( $options[3] ) ? 'asc' : $options[3] ;
|
---|
| 9 | $exclude = empty( $options[4] ) ? '' : $options[4] ;
|
---|
[205] | 10 | $exclude_tree = empty( $options[5] ) ? '' : $options[5] ;
|
---|
[127] | 11 | $includes = empty( $options[6] ) ? '' : $options[6] ;
|
---|
| 12 | $depth = !is_numeric( $options[7] ) ? 0 : $options[7] ;
|
---|
| 13 | $child_of = !is_numeric( $options[8] ) ? 0 : $options[8] ;
|
---|
| 14 | $show_date = empty( $options[9] ) ? 'none' : $options[9] ;
|
---|
| 15 | $date_format = empty( $options[10] ) ? '' : $options[10] ;
|
---|
| 16 | $hierarchical = empty( $options[11] ) ? false : true ;
|
---|
| 17 | $meta_key = empty( $options[12] ) ? '' : $options[12] ;
|
---|
| 18 | $meta_value = empty( $options[13] ) ? '' : $options[13] ;
|
---|
[118] | 19 |
|
---|
| 20 | if (empty($date_format)) $date_format = get_option('date_format');
|
---|
[127] | 21 | if ($exclude_tree == 0 ) $exclude_tree = '';
|
---|
| 22 | if ($show_date == 'none' ) $show_date = '';
|
---|
| 23 |
|
---|
[360] | 24 | if (xpress_is_wp_version('>=','2.2')){
|
---|
[262] | 25 | $parm = array(
|
---|
| 26 | 'sort_column' => $sort_column,
|
---|
| 27 | 'sort_order' => $sort_order,
|
---|
| 28 | 'exclude' => $exclude,
|
---|
| 29 | 'exclude_tree' => $exclude_tree,
|
---|
| 30 | 'include' => $includes,
|
---|
| 31 | 'depth' => $depth,
|
---|
| 32 | 'child_of' => $child_of,
|
---|
| 33 | 'show_date' => $show_date,
|
---|
| 34 | 'date_format' => $date_format,
|
---|
| 35 | 'title_li' => '',
|
---|
| 36 | 'echo' => 0,
|
---|
| 37 | 'hierarchical' => $hierarchical,
|
---|
| 38 | 'meta_key' => $meta_key,
|
---|
| 39 | 'meta_value' => $meta_value
|
---|
| 40 | );
|
---|
| 41 | $output = "<ul>\n" . wp_list_pages($parm) . "\n</ul>\n";
|
---|
| 42 | } else {
|
---|
| 43 | $output = "<ul>\n";
|
---|
| 44 | ob_start();
|
---|
| 45 | wp_list_pages($parm);
|
---|
| 46 | $output .= ob_get_contents();
|
---|
| 47 | ob_end_clean();
|
---|
| 48 | $output .="\n</ul>\n";
|
---|
| 49 | }
|
---|
[127] | 50 | $block['list_pages'] = $output;
|
---|
[118] | 51 | return $block ;
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | ?> |
---|