Skip to:
Content

bbPress.org

Changeset 5850


Ignore:
Timestamp:
07/15/2015 10:17:40 PM (9 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.

Location:
trunk/src/includes/admin
Files:
3 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 ) ); ?>
  • trunk/src/includes/admin/replies.php

    r5842 r5850  
    322322        $anonymous_data = bbp_filter_anonymous_post_data();
    323323        $author_id      = bbp_get_reply_author_id( $reply_id );
    324         $is_edit        = (bool) isset( $_POST['save'] );
     324        $is_edit        = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) );
    325325
    326326        // Formally update the reply
  • trunk/src/includes/admin/topics.php

    r5829 r5850  
    316316        $anonymous_data = bbp_filter_anonymous_post_data();
    317317        $author_id      = bbp_get_topic_author_id( $topic_id );
    318         $is_edit        = (bool) isset( $_POST['save'] );
     318        $is_edit        = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) );
    319319
    320320        // Formally update the topic
Note: See TracChangeset for help on using the changeset viewer.