Changeset 15121 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-topic-resolution/inc/class-plugin.php
- Timestamp:
- 09/01/2026 07:01:20 PM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-topic-resolution/inc/class-plugin.php
r12459 r15121 265 265 */ 266 266 public function topic_resolution_handler( $action = '' ) { 267 if ( ! $this->is_enabled_on_forum() ) {268 return false;269 }270 271 267 // Bail if the action isn't meant for this function. 272 268 if ( $action != 'wporg_bbp_topic_resolution' ) { … … 284 280 $user_id = get_current_user_id(); 285 281 $resolution = $_POST[ self::META_KEY ]; 282 283 // Resolution must be enabled on the topic's forum, not on the one being viewed. 284 if ( $topic && ! $this->is_enabled_on_forum( bbp_get_topic_forum_id( $topic->ID ) ) ) { 285 return false; 286 } 286 287 287 288 // Check for empty topic id. … … 510 511 */ 511 512 public function user_can_resolve( $user_id, $topic_id ) { 512 $post = false; 513 $topic_id = bbp_get_topic_id(); 514 if ( $topic_id ) { 515 $post = get_post( $topic_id ); 516 } 513 // Authorize against the requested topic, only falling back to the displayed one. 514 $topic_id = bbp_get_topic_id( $topic_id ); 515 $post = $topic_id ? bbp_get_topic( $topic_id ) : false; 517 516 518 517 if ( $user_id && $post && ( user_can( $user_id, 'moderate', $topic_id ) || $user_id == $post->post_author ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)