Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/06/2015 11:29:43 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Topics: First pass at metabox for replies in single-topic edit

  • Includes topic-replies list-table class
  • Includes helper functions for hooking things in
  • Todo: cap checks or row-actions, maybe bulk-actions, formatting clean-up

See #2842.

File:
1 edited

Legend:

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

    r5868 r5886  
    548548}
    549549
     550/**
     551 * Output the topic replies metabox
     552 *
     553 * @since bbPress (r5886)
     554 *
     555 * @param type $topic
     556 *
     557 * @return type
     558 */
     559function bbp_topic_replies_metabox( $topic = false ) {
     560
     561    // Bail if no topic to load replies for
     562    if ( empty( $topic ) ) {
     563        return;
     564    }
     565
     566    // Pull in the list table class
     567    if ( ! class_exists( 'BBP_Topic_Replies_List_Table' ) ) {
     568        include_once bbpress()->admin->admin_dir . '/list-tables/topic-replies.php';
     569    }
     570
     571    // Load up the list table
     572    $replies_list_table = new BBP_Topic_Replies_List_Table();
     573    $replies_list_table->prepare_items( $topic->ID ); ?>
     574
     575    <form id="bbp-topic-replies" method="get">
     576        <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
     577
     578        <?php $replies_list_table->display(); ?>
     579    </form>
     580
     581    <?php
     582}
     583
    550584/** Users *********************************************************************/
    551585
Note: See TracChangeset for help on using the changeset viewer.