Changeset 8433
- Timestamp:
- 03/09/2019 07:55:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php
r8216 r8433 11 11 12 12 var $filter = false; 13 14 var $old_title = null; 13 15 14 16 public function __construct( $args ) { … … 150 152 */ 151 153 public function get_topic_title( $title, $topic_id ) { 154 155 // save the title 156 $this->old_title = $title; 157 152 158 if ( bbp_is_single_view() && 'reviews' == bbp_get_view_id() ) { 153 159 $user_id = bbp_get_topic_author_id( $topic_id ); … … 160 166 } 161 167 168 /** 169 * Undo the above topic title change for specific cases 170 * 171 * @param string $title The topic title 172 */ 173 public function undo_topic_title( $title ) { 174 if ( !empty( $this->old_title ) ) { 175 return $this->old_title; 176 } 177 return $title; 178 } 179 162 180 public function do_view_header() { 163 181 if ( ! bbp_is_single_view() || 'reviews' != bbp_get_view_id() ) { … … 167 185 // Add the filter for topic titles here. 168 186 add_filter( 'bbp_get_topic_title', array( $this, 'get_topic_title' ), 10, 2 ); 169 ?> 187 188 // Undo the above filter, for titles of replies to reviews. See #meta4254 189 add_filter( 'bbp_get_topic_last_topic_title', array( $this, 'undo_topic_title' ), 10, 1 ); 190 ?> 170 191 <link itemprop="applicationCategory" href="http://schema.org/OtherApplication" /> 171 192 <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
Note: See TracChangeset
for help on using the changeset viewer.