Making WordPress.org

Changeset 5358


Ignore:
Timestamp:
04/18/2017 06:00:14 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Rename Stick/Unstick action keys for plugin and theme topics in Stickies_Compat to avoid conflicts with the same actions for regular topics.

See #2747. Fixes #2418.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stickies-compat.php

    r5357 r5358  
    8585        // Bail if the action isn't meant for this function.
    8686        if ( ! in_array( $action, array(
    87             'wporg_bbp_stick_topic',
    88             'wporg_bbp_unstick_topic',
     87            'wporg_bbp_stick_compat_topic',
     88            'wporg_bbp_unstick_compat_topic',
    8989        ) ) ) {
    9090            return;
     
    122122
    123123        // Stick/unstick the topic.
    124         if ( 'wporg_bbp_stick_topic' == $action ) {
     124        if ( 'wporg_bbp_stick_compat_topic' == $action ) {
    125125            $success = self::add_sticky( $term->term_id, $topic->ID );
    126         } elseif ( 'wporg_bbp_unstick_topic' == $action ) {
     126        } elseif ( 'wporg_bbp_unstick_compat_topic' == $action ) {
    127127            $success = self::remove_sticky( $term->term_id, $topic->ID );
    128128        }
     
    132132        if ( $success && ! is_wp_error( $success ) ) {
    133133            bbp_redirect( $permalink );
    134         } elseif ( true === $is_sticky && 'wporg_bbp_stick_topic' == $action ) {
    135             bbp_add_error( 'wporg_bbp_stick_topic', __( '<strong>ERROR</strong>: There was a problem sticking that topic!', 'wporg-forums' ) );
    136         } elseif ( false === $is_sticky && 'wporg_bbp_unstick_topic' == $action ) {
    137             bbp_add_error( 'wporg_bbp_unstick_topic', __( '<strong>ERROR</strong>: There was a problem unsticking that topic!', 'wporg-forums' ) );
     134        } elseif ( true === $is_sticky && 'wporg_bbp_stick_compat_topic' == $action ) {
     135            bbp_add_error( 'wporg_bbp_stick_compat_topic', __( '<strong>ERROR</strong>: There was a problem sticking that topic!', 'wporg-forums' ) );
     136        } elseif ( false === $is_sticky && 'wporg_bbp_unstick_compat_topic' == $action ) {
     137            bbp_add_error( 'wporg_bbp_unstick_compat_topic', __( '<strong>ERROR</strong>: There was a problem unsticking that topic!', 'wporg-forums' ) );
    138138        }
    139139    }
     
    189189        if ( self::is_sticky( $term->term_id, $topic->ID ) ) {
    190190            $text = $r['unstick'];
    191             $query_args = array( 'action' => 'wporg_bbp_unstick_topic', 'topic_id' => $topic->ID, 'term_id' => $term->term_id );
     191            $query_args = array( 'action' => 'wporg_bbp_unstick_compat_topic', 'topic_id' => $topic->ID, 'term_id' => $term->term_id );
    192192        } else {
    193193            $text = $r['stick'];
    194             $query_args = array( 'action' => 'wporg_bbp_stick_topic', 'topic_id' => $topic->ID, 'term_id' => $term->term_id );
     194            $query_args = array( 'action' => 'wporg_bbp_stick_compat_topic', 'topic_id' => $topic->ID, 'term_id' => $term->term_id );
    195195        }
    196196
Note: See TracChangeset for help on using the changeset viewer.