From 62a0ba89c37c52e68715f8c6733f16e985ef1ae6 Mon Sep 17 00:00:00 2001
From: Christoph Herbst <chris.p.herbst@gmail.com>
Date: Tue, 12 Jan 2021 12:46:55 +0100
Subject: [PATCH] use same action variables for GET & POST
this affects move, split & merge
This fixes: https://bbpress.trac.wordpress.org/ticket/3365
---
includes/common/template.php | 6 +++---
includes/extend/buddypress/groups.php | 6 +++---
includes/replies/template.php | 4 ++--
includes/topics/template.php | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/includes/common/template.php b/includes/common/template.php
index 83fa820..d9a77d6 100644
a
|
b
|
function bbp_is_topic_merge() { |
316 | 316 | $retval = false; |
317 | 317 | |
318 | 318 | // Check topic edit and GET params |
319 | | if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'merge' === $_GET['action'] ) ) { |
| 319 | if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'bbp-merge-topic' === $_GET['action'] ) ) { |
320 | 320 | return true; |
321 | 321 | } |
322 | 322 | |
… |
… |
function bbp_is_topic_split() { |
337 | 337 | $retval = false; |
338 | 338 | |
339 | 339 | // Check topic edit and GET params |
340 | | if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'split' === $_GET['action'] ) ) { |
| 340 | if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'bbp-split-topic' === $_GET['action'] ) ) { |
341 | 341 | $retval = true; |
342 | 342 | } |
343 | 343 | |
… |
… |
function bbp_is_reply_move() { |
499 | 499 | $retval = false; |
500 | 500 | |
501 | 501 | // Check reply edit and GET params |
502 | | if ( bbp_is_reply_edit() && ! empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) { |
| 502 | if ( bbp_is_reply_edit() && ! empty( $_GET['action'] ) && ( 'bbp-move-reply' === $_GET['action'] ) ) { |
503 | 503 | $retval = true; |
504 | 504 | } |
505 | 505 | |
diff --git a/includes/extend/buddypress/groups.php b/includes/extend/buddypress/groups.php
index 0bd7cbc..e4d7910 100644
a
|
b
|
class BBP_Forums_Group_Extension extends BP_Group_Extension { |
1076 | 1076 | $bbp->current_topic_id = get_the_ID(); |
1077 | 1077 | |
1078 | 1078 | // Merge |
1079 | | if ( ! empty( $_GET['action'] ) && 'merge' === $_GET['action'] ) : |
| 1079 | if ( ! empty( $_GET['action'] ) && 'bbp-merge-topic' === $_GET['action'] ) : |
1080 | 1080 | bbp_set_query_name( 'bbp_topic_merge' ); |
1081 | 1081 | bbp_get_template_part( 'form', 'topic-merge' ); |
1082 | 1082 | |
1083 | 1083 | // Split |
1084 | | elseif ( ! empty( $_GET['action'] ) && 'split' === $_GET['action'] ) : |
| 1084 | elseif ( ! empty( $_GET['action'] ) && 'bbp-split-topic' === $_GET['action'] ) : |
1085 | 1085 | bbp_set_query_name( 'bbp_topic_split' ); |
1086 | 1086 | bbp_get_template_part( 'form', 'topic-split' ); |
1087 | 1087 | |
… |
… |
class BBP_Forums_Group_Extension extends BP_Group_Extension { |
1146 | 1146 | $bbp->current_reply_id = get_the_ID(); |
1147 | 1147 | |
1148 | 1148 | // Move |
1149 | | if ( ! empty( $_GET['action'] ) && ( 'move' === $_GET['action'] ) ) : |
| 1149 | if ( ! empty( $_GET['action'] ) && ( 'bbp-move-reply' === $_GET['action'] ) ) : |
1150 | 1150 | bbp_set_query_name( 'bbp_reply_move' ); |
1151 | 1151 | bbp_get_template_part( 'form', 'reply-move' ); |
1152 | 1152 | |
diff --git a/includes/replies/template.php b/includes/replies/template.php
index 2dc25e1..2732dae 100644
a
|
b
|
function bbp_reply_move_link( $args = array() ) { |
2096 | 2096 | } |
2097 | 2097 | |
2098 | 2098 | $uri = add_query_arg( array( |
2099 | | 'action' => 'move', |
| 2099 | 'action' => 'bbp-move-reply', |
2100 | 2100 | 'reply_id' => $reply_id |
2101 | 2101 | ), bbp_get_reply_edit_url( $reply_id ) ); |
2102 | 2102 | |
… |
… |
function bbp_topic_split_link( $args = array() ) { |
2155 | 2155 | } |
2156 | 2156 | |
2157 | 2157 | $uri = add_query_arg( array( |
2158 | | 'action' => 'split', |
| 2158 | 'action' => 'bbp-split-topic', |
2159 | 2159 | 'reply_id' => $reply_id |
2160 | 2160 | ), bbp_get_topic_edit_url( $topic_id ) ); |
2161 | 2161 | |
diff --git a/includes/topics/template.php b/includes/topics/template.php
index 76711e9..52b242b 100644
a
|
b
|
function bbp_topic_merge_link( $args = array() ) { |
2764 | 2764 | return; |
2765 | 2765 | } |
2766 | 2766 | |
2767 | | $uri = add_query_arg( array( 'action' => 'merge' ), bbp_get_topic_edit_url( $topic->ID ) ); |
| 2767 | $uri = add_query_arg( array( 'action' => 'bbp-merge-topic' ), bbp_get_topic_edit_url( $topic->ID ) ); |
2768 | 2768 | $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-merge-link">' . $r['merge_text'] . '</a>' . $r['link_after']; |
2769 | 2769 | |
2770 | 2770 | // Filter & return |