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