Skip to:
Content

bbPress.org

Changeset 4259


Ignore:
Timestamp:
10/19/2012 08:11:39 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Dropdowns:

  • Revert back to text inputs for topic and forum ID's in metaboxes.
  • Fixes memory issues when loading thousands of posts.
  • Fixes #1878.
  • See #1901.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bbp-includes/admin/metaboxes.php

    r4250 r4259  
    299299        <strong class="label"><?php _e( 'Parent:', 'bbpress' ); ?></strong>
    300300        <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum Parent', 'bbpress' ); ?></label>
    301 
    302         <?php
    303             bbp_dropdown( array(
    304                 'exclude'            => $post_id,
    305                 'selected'           => $post_parent,
    306                 'show_none'          => __( '(No Parent)', 'bbpress' ),
    307                 'select_id'          => 'parent_id',
    308                 'disable_categories' => false
    309             ) );
    310         ?>
    311 
     301        <input name="parent_id" id="parent_id" type="number" step="1" value="<?php echo esc_attr( $post_parent ); ?>" />
    312302    </p>
    313303
     
    315305        <strong class="label"><?php _e( 'Order:', 'bbpress' ); ?></strong>
    316306        <label class="screen-reader-text" for="menu_order"><?php _e( 'Forum Order', 'bbpress' ); ?></label>
    317         <input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $menu_order; ?>" />
     307        <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" />
    318308    </p>
    319309
     
    333323 *
    334324 * @uses bbp_get_topic_forum_id() To get the topic forum id
    335  * @uses bbp_dropdown() To show a dropdown of the forums for topic parent
    336325 * @uses do_action() Calls 'bbp_topic_metabox'
    337326 */
     
    339328
    340329    // Post ID
    341     $post_id = get_the_ID();
    342 
    343     $args = array(
    344         'selected'  => bbp_get_topic_forum_id( $post_id ),
    345         'select_id' => 'parent_id',
    346         'show_none' => is_super_admin() ? __( '(No Forum)', 'bbpress' ) : '',
    347     ); ?>
    348 
    349     <p><strong><?php _e( 'Forum', 'bbpress' ); ?></strong></p>
    350 
    351     <p>
    352         <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum', 'bbpress' ); ?></label>
    353         <?php bbp_dropdown( $args ); ?>
    354     </p>
     330    $post_id = get_the_ID(); ?>
    355331
    356332    <p><strong><?php _e( 'Topic Type', 'bbpress' ); ?></strong></p>
     
    359335        <label class="screen-reader-text" for="bbp_stick_topic"><?php _e( 'Topic Type', 'bbpress' ); ?></label>
    360336        <?php bbp_topic_type_select( array( 'topic_id' => $post_id ) ); ?>
     337    </p>
     338
     339    <p><strong><?php _e( 'Forum', 'bbpress' ); ?></strong></p>
     340
     341    <p>
     342        <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum', 'bbpress' ); ?></label>
     343        <input name="parent_id" id="parent_id" type="number" step="1" value="<?php bbp_topic_forum_id( $post_id ); ?>" />
    361344    </p>
    362345
     
    376359 *
    377360 * @uses bbp_get_topic_post_type() To get the topic post type
    378  * @uses bbp_dropdown() To show a dropdown of the topics for reply parent
    379361 * @uses do_action() Calls 'bbp_reply_metabox'
    380362 */
     
    389371
    390372    // Allow individual manipulation of reply forum
    391     if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) :
    392 
    393         // Forums
    394         $args = array(
    395             'selected'  => $reply_forum_id,
    396             'select_id' => 'bbp_forum_id',
    397             'show_none' => __( '(Use Forum of Topic)', 'bbpress' )
    398         ); ?>
     373    if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?>
    399374
    400375        <p><strong><?php _e( 'Forum', 'bbpress' ); ?></strong></p>
     
    402377        <p>
    403378            <label class="screen-reader-text" for="bbp_forum_id"><?php _e( 'Forum', 'bbpress' ); ?></label>
    404 
    405             <?php bbp_dropdown( $args ); ?>
    406 
     379            <input name="bbp_forum_id" id="bbp_forum_id" type="number" step="1" value="<?php echo esc_attr( $reply_forum_id ); ?>" />
    407380        </p>
    408381
    409     <?php endif;
    410 
    411     // Topics
    412     $args = array(
    413         'post_type'   => bbp_get_topic_post_type(),
    414         'selected'    => $reply_topic_id,
    415         'select_id'   => 'parent_id',
    416         'orderby'     => 'post_date',
    417         'numberposts' => '250',
    418         'show_none'   => is_super_admin() ? __( '(No Topic)', 'bbpress' ) : '',
    419     );
    420 
    421     // Allow the dropdown to be filtered, to extend or limit the available
    422     // topics to choose as the reply parent.
    423     $args = apply_filters( 'bbp_reply_parent_dropdown', $args ); ?>
     382    <?php endif; ?>
    424383
    425384    <p><strong><?php _e( 'Topic', 'bbpress' ); ?></strong></p>
     
    427386    <p>
    428387        <label class="screen-reader-text" for="parent_id"><?php _e( 'Topic', 'bbpress' ); ?></label>
    429 
    430         <?php bbp_dropdown( $args ); ?>
    431 
     388        <input name="parent_id" id="parent_id" type="number" step="1" value="<?php echo esc_attr( $reply_topic_id ); ?>" />
    432389    </p>
    433390
Note: See TracChangeset for help on using the changeset viewer.