XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/category_block_theme.php @ 252

Last change on this file since 252 was 252, checked in by toemon, 15 years ago

WordPressME2.0.11への対応,(ブロック周りは未完)

File size: 2.1 KB
Line 
1<?php
2
3function category_block($options)
4{
5        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
6        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_category.html' : trim( $options[1] );
7        $show_option_all = empty( $options[2] ) ? '' : $options[2] ;
8        $orderby = empty( $options[3] ) ? 'name' : $options[3] ;
9        $order = empty( $options[4] ) ? 'ASC' : $options[4] ;
10        $show_last_updated = empty( $options[5] ) ? false : true ;
11        $show_count = empty( $options[6] ) ? false : true ;
12        $hide_empty = empty( $options[7] ) ? false : true ;
13        $use_desc_for_title = empty( $options[8] ) ? false : true ;
14        $exclude = empty( $options[9] ) ? '' : $options[9] ;
15        $includes = empty( $options[10] ) ? '' : $options[10] ;
16        $hierarchical = empty( $options[11] ) ? false : true ;
17        $depth  = !is_numeric( $options[12] ) ? 0 : $options[12] ;
18       
19        if (function_exists('wp_list_categories')){
20                $param = array(
21                        'show_option_all' => $show_option_all,
22                        'orderby' => $orderby,
23                        'order' => $order,
24                        'show_last_update' => $show_last_updated,
25                        'style' => 'list',
26                        'show_count' => $show_count,
27                        'hide_empty' => $hide_empty,
28                        'use_desc_for_title' => $use_desc_for_title,
29                        'child_of' => 0,
30                        'feed' => '',
31                        'feed_image' => '',
32                        'exclude' => $exclude,
33                        'include' => $includes,
34                        'hierarchical' => $hierarchical,
35                        'title_li' => '',
36                        'number' => '',
37                        'echo' => 0,
38                        'depth' => $depth
39                );
40                $block['categories'] = wp_list_categories($param);
41        } else {
42                if (empty($show_option_all))
43                        $optionall = 0;
44                else
45                        $optionall = 1;
46                $param = array(
47                        'optionall' => $optionall,
48                        'all' => $show_option_all,
49                        'sort_column' => $orderby,
50                        'sort_order' => $order,
51                        'show_last_update' => $show_last_updated,
52                        'optioncount' => $show_count,
53                        'hide_empty' => $hide_empty,
54                        'use_desc_for_title' => $use_desc_for_title,
55                        'child_of' => 0,
56                        'feed' => '',
57                        'feed_image' => '',
58                        'exclude' => $exclude,
59                        'hierarchical' => $hierarchical,
60                        'recurse' => 1,
61                );
62                $block['categories'] = wp_list_cats($param);
63               
64        }
65        return $block ;
66}
67
68?>
Note: See TracBrowser for help on using the repository browser.