Skip to:
Content

bbPress.org

Changeset 6886


Ignore:
Timestamp:
12/20/2018 09:24:09 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Subscriptions: Do not add or remove subscriptions when editing via WordPress admin.

This change passes the current post ID through to bbp_is_user_subscribed(), ensuring that admin area subscriptions are saved to the correct topic ID (not revisions, etc...) while also not changing the subscriptions status.

Fixes #3235.

File:
1 edited

Legend:

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

    r6811 r6886  
    745745function bbp_topic_subscriptions_metabox( $post ) {
    746746
     747    // Current user subscription
     748    $input_value = bbp_is_user_subscribed( bbp_get_current_user_id(), $post->ID )
     749        ? 'bbp_subscribe' // maintain existing subscription
     750        : '';             // do not add or remove subscription
     751
    747752    // Get user IDs
    748753    $user_ids = bbp_get_subscribers( $post->ID );
     
    750755    // Output
    751756    ?>
    752     <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="hidden" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
     757    <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="hidden" value="<?php echo esc_attr( $input_value ); ?>" />
    753758    <p><?php
    754759
Note: See TracChangeset for help on using the changeset viewer.