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] );
|
---|
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] ;
|
---|
10 | $exclude_tree = empty( $options[5] ) ? '' : $options[5] ;
|
---|
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] ;
|
---|
19 |
|
---|
20 | if (empty($date_format)) $date_format = get_option('date_format');
|
---|
21 | if ($exclude_tree == 0 ) $exclude_tree = '';
|
---|
22 | if ($show_date == 'none' ) $show_date = '';
|
---|
23 |
|
---|
24 | $parm = array(
|
---|
25 | 'sort_column' => $sort_column,
|
---|
26 | 'sort_order' => $sort_order,
|
---|
27 | 'exclude' => $exclude,
|
---|
28 | 'exclude_tree' => $exclude_tree,
|
---|
29 | 'include' => $includes,
|
---|
30 | 'depth' => $depth,
|
---|
31 | 'child_of' => $child_of,
|
---|
32 | 'show_date' => $show_date,
|
---|
33 | 'date_format' => $date_format,
|
---|
34 | 'title_li' => '',
|
---|
35 | 'echo' => 0,
|
---|
36 | 'hierarchical' => $hierarchical,
|
---|
37 | 'meta_key' => $meta_key,
|
---|
38 | 'meta_value' => $meta_value
|
---|
39 | );
|
---|
40 |
|
---|
41 | $output = "<ul>\n" . wp_list_pages($parm) . "\n</ul>\n";
|
---|
42 | $block['list_pages'] = $output;
|
---|
43 | return $block ;
|
---|
44 | }
|
---|
45 |
|
---|
46 | ?> |
---|