Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/15/2015 10:17:40 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Admin: Add hidden_post_status field back to topic & reply metaboxes, and use draft or current post status as value.

This changeset fixes a bug that caused topics & replies to be marked as edited when moderated via wp-admin.

Hat-tip tharsheblows. Fixes #2741.

File:
1 edited

Legend:

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

    r5770 r5850  
    392392        // Post ID
    393393        $post_id = get_the_ID();
     394        $status  = get_post_status( $post_id );
    394395
    395396        /** Type ******************************************************************/
    … …  
    411412        <p>
    412413                <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
     414                <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $status ) ? 'draft' : $status ); ?>" />
    413415                <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the topic.', 'bbpress' ); ?></label>
    414416                <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post_id ) ); ?>
    … …  
    467469        // Post ID
    468470        $post_id = get_the_ID();
     471        $status  = get_post_status( $post_id );
    469472
    470473        // Get some meta
    … …  
    479482        <p>
    480483                <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
     484                <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $status ) ? 'draft' : $status ); ?>" />
    481485                <label class="screen-reader-text" for="post_status"><?php esc_html_e( 'Select what status to give the reply.', 'bbpress' ); ?></label>
    482486                <?php bbp_form_reply_status_dropdown( array( 'select_id' => 'post_status', 'reply_id' => $post_id ) ); ?>
Note: See TracChangeset for help on using the changeset viewer.