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