XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/tag_cloud_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: 1.2 KB
Line 
1<?php
2function tag_cloud_block($options)
3{
4        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
5        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_meta.html' : trim( $options[1]);
6        $smallest = !is_numeric( $options[2] ) ? 8 : $options[2] ;
7        $largest = !is_numeric( $options[3] ) ? 22 : $options[3] ;
8        $unit = empty( $options[4] ) ? 'pt' : $options[4] ;
9        $number = !is_numeric( $options[5] ) ? 45 : $options[5] ;
10        $format = empty( $options[6] ) ? 'flat' : $options[6] ;
11        $orderby = empty( $options[7] ) ? 'name' : $options[7] ;
12        $order = empty( $options[8] ) ? 'ASC' : $options[8] ;
13        $exclude = is_null( $options[9] ) ? '' : $options[9] ;
14        $wp_include = is_null( $options[10] ) ? '' : $options[10] ;
15       
16        $param=array(
17                'smallest' => $smallest,
18                'largest' => $largest,
19                'unit' => $unit,
20                'number' => $number,
21                'format' => $format,
22                'orderby' => $orderby,
23                'order' => $order,
24                'exclude' => $exclude,
25                'include' => $wp_include
26        );
27        if (function_exists('wp_tag_cloud')) {
28                ob_start();
29                        wp_tag_cloud($param);
30                        $output = ob_get_contents();
31                ob_end_clean();
32        } else {
33                $output = 'not function wp_tag_cloud()';
34        }
35        $block['tag_cloud'] = $output;                                                         
36        return $block ;
37}
38?>
Note: See TracBrowser for help on using the repository browser.