Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/15/2015 04:30:34 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Moderators: Introduce none argument for topic-tags & forum-mods list functions.

This change allows for passing text or HTML to output if no taxonomy terms are found, and uses this new functionality in wp-admin to show per-forum moderators in the list-table column, also reducing code duplication.

See #459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/forums.php

    r5834 r5835  
    696696
    697697            case 'bbp_forum_mods' :
    698                 $moderators = wp_get_object_terms( $forum_id, bbp_get_forum_mod_tax_id() );
    699                 if ( empty( $moderators ) ) {
    700                     esc_html__( 'None', 'bbpress' );
    701                 } else {
    702                     echo implode( ', ', wp_list_pluck( $moderators, 'name' ) );
    703                 }
     698                bbp_forum_mod_list( $forum_id, array(
     699                    'before' => '',
     700                    'after'  => '',
     701                    'none'   => esc_html__( '—', 'bbpress' )
     702                ) );
    704703                break;
    705704
Note: See TracChangeset for help on using the changeset viewer.