XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/authors_block_theme.php @ 292

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

WP2011の投稿者ブロックのブロックオプションが無効 fixes #156
r284 で修正を行ったが、
WP2.7ではwp_list_authors()でechoを抑制できるので,WP2011と処理を分けることにする

File size: 1.4 KB
Line 
1<?php
2function authors_block($options)
3{
4        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
5        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_authors.html' : trim( $options[1] );
6        $optioncount = empty( $options[2] ) ? 0 : 1 ;
7        $exclude_admin = empty( $options[3] ) ? 0 : 1 ;
8        $show_fullname = empty( $options[4] ) ? 0 : 1 ;
9        $hide_empty = empty( $options[5] ) ? 0 : 1 ;           
10        $mydirpath = get_xpress_dir_path();
11       
12        if(xpress_is_wp20() ){
13                $param_str = 'optioncount='. $optioncount . '&exclude_admin=' . $exclude_admin .'&show_fullname='. $show_fullname . '&hide_empty=' . $hide_empty;
14                ob_start();
15                        wp_list_authors($param_str); //WP2011 wp_list_authors() used only parse_str()
16                        $list_authors = ob_get_contents() ;
17                ob_end_clean();
18        } else {
19                $param = array(
20                        'optioncount' => $optioncount,
21                        'exclude_admin' => $exclude_admin,
22                        'show_fullname' => $show_fullname,
23                        'hide_empty' => $hide_empty,
24                        'feed' => '',
25                        'feed_image' => '',
26                        'echo' => false
27                );
28                $list_authors = wp_list_authors($param);
29        }
30        if (xpress_is_multi_user()){
31                $all_link = '<li>' . '<a href="' . get_bloginfo('url'). '" title="' . __('All Authors','xpress') . '">' .__('All Authors','xpress') . '</a></li>';
32        } else {
33                $all_link = '';
34        }
35        $output = "<ul>\n" . $all_link . $list_authors . "\n</ul>\n";
36       
37        $block['authors'] = $output;
38       
39        return $block ;
40}
41?>
Note: See TracBrowser for help on using the repository browser.