Skip to:
Content

bbPress.org

Ticket #3374: 3374.patch

File 3374.patch, 761 bytes (added by johnjamesjacoby, 6 years ago)

Escape & excerpt Forum description in admin-area list-table

  • src/includes/admin/forums.php

     
    635635                        }
    636636                }
    637637
    638                 // simple hack to show the forum description under the title
    639                 bbp_forum_content( $forum->ID );
     638                // Only show content if user can read it and there is no password
     639                if ( current_user_can( 'read_forum', $forum->ID ) && ! post_password_required( $forum ) ) {
    640640
     641                        // Get the forum description
     642                        $content = bbp_get_forum_content( $forum->ID );
     643
     644                        // Only proceed if there is a description
     645                        if ( ! empty( $content ) ) {
     646                                echo '<div class="bbp-escaped-content">' . esc_html( wp_trim_excerpt( $content, $forum ) ) . '</div>';
     647                        }
     648                }
     649
    641650                // Sort & return
    642651                return $this->sort_row_actions( $actions );
    643652        }