Rev | Line | |
---|
[110] | 1 | <?php
|
---|
[448] | 2 | // Block Version: 1.0
|
---|
[110] | 3 | function authors_block($options)
|
---|
| 4 | {
|
---|
| 5 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
[120] | 6 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_authors.html' : trim( $options[1] );
|
---|
[284] | 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 ;
|
---|
[110] | 11 | $mydirpath = get_xpress_dir_path();
|
---|
| 12 |
|
---|
[360] | 13 | if(xpress_is_wp_version('<','2.3') ){
|
---|
[292] | 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 | }
|
---|
[161] | 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";
|
---|
[110] | 37 |
|
---|
[126] | 38 | $block['authors'] = $output;
|
---|
| 39 |
|
---|
[110] | 40 | return $block ;
|
---|
| 41 | }
|
---|
| 42 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.