- Timestamp:
- Mar 21, 2009, 12:37:24 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/xpress_default/blocks/page_block_theme.php
r121 r127 5 5 $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 6 6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_page_block.html' : trim( $options[1] ); 7 $sort_column = empty( $options[2] ) ? 0 : $options[2] ; 8 $sort_order_asc = empty( $options[3] ) ? 0 : 1 ; 9 $show_date = empty( $options[4] ) ? 0 : 1 ; 10 $date_format = empty( $options[5] ) ? '' : $options[5] ; 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 = !is_numeric( $options[5] ) ? 0 : $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] ; 11 19 12 switch ($sort_column) {13 case 0:14 $sort_column_name = 'post_title';15 break ;16 case 1:17 $sort_column_name = 'post_date';18 break ;19 case 2:20 $sort_column_name = 'menu_order';21 break ;22 default:23 $sort_column_name = 'post_title';24 break ;25 }26 20 if (empty($date_format)) $date_format = get_option('date_format'); 27 if ($show_date) $show_date_name = 'post_date' ; else $show_date_name = ''; 21 if ($exclude_tree == 0 ) $exclude_tree = ''; 22 if ($show_date == 'none' ) $show_date = ''; 23 28 24 $parm = array( 29 'depth' => 0, 30 'title_li' => '', 31 'show_date' => $show_date_name, 32 'date_format' => $date_format, 33 'child_of' => 0, 34 'exclude' => '', 35 'echo' => 0, 36 'authors' => '', 37 'sort_column' => $sort_column_name 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 38 39 ); 39 40 40 $content = wp_list_pages($parm); 41 $item_no = 0; 42 $row_data = array( 43 'page' => $content 44 ); 45 $block['contents']['item'.$item_no] = $row_data; 46 $item_no++; 47 48 $block['data_count'] = $item_no; //xml unserialise error 49 41 $output = "<ul>\n" . wp_list_pages($parm) . "\n</ul>\n"; 42 $block['list_pages'] = $output; 50 43 return $block ; 51 44 }
Note: See TracChangeset
for help on using the changeset viewer.