Changeset 12410 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
- Timestamp:
- 02/21/2023 05:48:06 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r12347 r12410 19 19 abstract protected function name(); 20 20 abstract protected function parse_query(); 21 abstract protected function for_slug( $slug ); 21 22 abstract protected function do_view_sidebar(); 22 23 abstract protected function do_topic_sidebar(); … … 68 69 69 70 } 71 } 72 73 /** 74 * Maybe load the data for this compat directory class. 75 * 76 * @param int $topic_id The topic ID that we should initialize in the context of. 77 */ 78 public function init_for_topic( $topic_id ) { 79 $forum_id = bbp_get_topic_forum_id( $topic_id ); 80 if ( $forum_id != $this->forum_id() ) { 81 return; 82 } 83 84 $terms = get_the_terms( $topic_id, $this->taxonomy() ); 85 if ( ! $terms ) { 86 return; 87 } 88 89 $this->for_slug( $terms[0]->slug ); 70 90 } 71 91 … … 828 848 // Note: Not using $this->title() here so as to filter other terms of this taxonomy correctly. 829 849 830 $term->name = $this->get_object( $term->slug )->post_title ?? $term->name; 850 if ( ! is_admin() ) { 851 $term->name = $this->get_object( $term->slug )->post_title ?? $term->name; 852 } 831 853 832 854 return $term;
Note: See TracChangeset
for help on using the changeset viewer.