diff --git wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
index 673983b2e..5cfd6861c 100644
|
|
|
class Hooks {
|
| 1096 | 1096 | public function bbp_raw_title_array( $title ) { |
| 1097 | 1097 | if ( bbp_is_single_forum() || bbp_is_single_topic() || bbp_is_single_view() ) { |
| 1098 | 1098 | $title['format'] = '%s'; |
| | 1099 | |
| | 1100 | if( wporg_support_is_single_review() ) { |
| | 1101 | $title['text'] .= sprintf( ' - [%s] %s', |
| | 1102 | wporg_support_get_single_review_title(), |
| | 1103 | __( 'Review', 'wporg-forums' ) |
| | 1104 | ); |
| | 1105 | } |
| 1099 | 1106 | } |
| 1100 | 1107 | |
| 1101 | 1108 | return $title; |
diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
index 47a6bb43c..dfd56e350 100644
|
|
|
function wporg_support_is_single_review() {
|
| 338 | 338 | return ( WordPressdotorg\Forums\Plugin::REVIEWS_FORUM_ID == bbp_get_topic_forum_id() ); |
| 339 | 339 | } |
| 340 | 340 | |
| | 341 | /** |
| | 342 | * Get post title for single review |
| | 343 | * |
| | 344 | * @return string|bool Returns post title if it exists. Otherwise returns false. |
| | 345 | */ |
| | 346 | function wporg_support_get_single_review_title() { |
| | 347 | if ( ! class_exists( 'WordPressdotorg\Forums\Plugin' ) || ! bbp_is_single_topic() ) { |
| | 348 | return false; |
| | 349 | } |
| | 350 | |
| | 351 | $plugin_instance = WordPressdotorg\Forums\Plugin::get_instance(); |
| | 352 | $review = $plugin_instance->plugins->plugin ?? $plugin_instance->themes->theme; |
| | 353 | |
| | 354 | return isset( $review ) ? $review->post_title : false; |
| | 355 | } |
| | 356 | |
| 341 | 357 | /** |
| 342 | 358 | * Check if the current page is a user's "Reviews Written" page. |
| 343 | 359 | * |