Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/26/2017 08:46:41 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Admin: in list-tables, if no parent forum/topic, show — instead.

Also make sure a few strings are escaped, and dropdowns are using correct parent text.

File:
1 edited

Legend:

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

    r6400 r6424  
    929929            case 'bbp_topic_forum' :
    930930
     931                // Get title
     932                $forum_title = ! empty( $forum_id )
     933                    ? bbp_get_forum_title( $forum_id )
     934                    : '';
     935
    931936                // Output forum name
    932                 if ( ! empty( $forum_id ) ) {
    933 
    934                     // Forum Title
    935                     $forum_title = bbp_get_forum_title( $forum_id );
    936                     if ( empty( $forum_title ) ) {
    937                         $forum_title = esc_html__( 'No Forum', 'bbpress' );
    938                     }
    939 
    940                     // Output the title
     937                if ( ! empty( $forum_title ) ) {
    941938                    echo $forum_title;
    942939
     940                // Output dash
    943941                } else {
    944                     esc_html_e( '— No forum —', 'bbpress' );
     942                    ?>
     943                    <span aria-hidden="true">&mdash;</span>
     944                    <span class="screen-reader-text"><?php esc_html_e( 'No forum', 'bbpress' ); ?></span>
     945                    <?php
    945946                }
    946947
     
    10801081        // Do not show trash links for spam topics, or spam links for trashed topics
    10811082        if ( current_user_can( 'delete_topic', $topic->ID ) ) {
     1083            $trash_days = bbp_get_trash_days( bbp_get_topic_post_type() );
     1084
    10821085            if ( bbp_get_trash_status_id() === $topic->post_status ) {
    10831086                $post_type_object   = get_post_type_object( bbp_get_topic_post_type() );
    10841087                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
    1085             } elseif ( EMPTY_TRASH_DAYS ) {
     1088            } elseif ( ! empty( $trash_days ) ) {
    10861089                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
    10871090            }
    10881091
    1089             if ( bbp_get_trash_status_id() === $topic->post_status || !EMPTY_TRASH_DAYS ) {
     1092            if ( ( bbp_get_trash_status_id() === $topic->post_status ) || empty( $trash_days ) ) {
    10901093                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    10911094            } elseif ( bbp_get_spam_status_id() === $topic->post_status ) {
     
    11281131        bbp_dropdown( array(
    11291132            'selected'  => $selected,
    1130             'show_none' => __( 'In all forums', 'bbpress' )
     1133            'show_none' => esc_html__( 'In all forums', 'bbpress' )
    11311134        ) );
    11321135    }
Note: See TracChangeset for help on using the changeset viewer.