Changeset 5058
- Timestamp:
- 03/03/2017 06:13:42 PM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r4983 r5058 6 6 7 7 abstract protected function compat(); 8 abstract protected function compat_views(); 8 9 abstract protected function compat_title(); 9 10 abstract protected function reviews_title(); 10 abstract protected function activ ity_title();11 abstract protected function active_title(); 11 12 abstract protected function slug(); 12 13 abstract protected function title(); … … 110 111 111 112 // Compat views are hooked in a special order, and need help with feed queries. 112 if ( isset( $query_vars['bbp_view'] ) && in_array( $query_vars['bbp_view'], array( $this->compat(), 'reviews', 'active') ) ) {113 if ( isset( $query_vars['bbp_view'] ) && in_array( $query_vars['bbp_view'], $this->compat_views() ) ) { 113 114 $this->query = $query_vars; 114 115 add_filter( 'bbp_get_view_query_args', array( $this, 'get_view_query_args_for_feed' ), 10, 2 ); … … 173 174 174 175 switch ( $this->query['bbp_view'] ) { 175 case 'plugin': 176 case 'theme': 176 case $this->compat(): 177 177 $translation = $this->compat_title(); 178 178 break; … … 181 181 break; 182 182 case 'active': 183 $translation = $this->activ ity_title();183 $translation = $this->active_title(); 184 184 break; 185 185 } … … 345 345 ( bbp_is_single_forum() && Plugin::REVIEWS_FORUM_ID == bbp_get_forum_id() ) 346 346 || 347 ( bbp_is_single_view() && ! in_array( bbp_get_view_id(), array( 'plugin', 'theme', 'reviews', 'active') ) )347 ( bbp_is_single_view() && ! in_array( bbp_get_view_id(), $this->compat_views() ) ) 348 348 ) { 349 349 $terms = get_the_terms( $topic_id, $this->taxonomy() ); … … 448 448 bbp_register_view( 449 449 'active', 450 $this->activ ity_title(),450 $this->active_title(), 451 451 array( 452 452 'post_parent' => $this->forum_id(), … … 469 469 470 470 $view = bbp_get_view_id( $view ); 471 if ( ! in_array( $view, array( 'active', 'reviews', $this->compat()) ) ) {471 if ( ! in_array( $view, $this->compat_views() ) ) { 472 472 return $url; 473 473 } … … 476 476 if ( $wp_rewrite->using_permalinks() ) { 477 477 switch ( $view ) { 478 case 'reviews' : 478 479 case 'active' : 479 case 'reviews' :480 480 $url = $wp_rewrite->root . $this->compat() . '/' . $this->slug() . '/' . $view; 481 481 break; … … 507 507 508 508 $view = bbp_get_view_id(); 509 if ( ! in_array( $view, array( $this->compat(), 'reviews', 'active') ) ) {509 if ( ! in_array( $view, $this->compat_views() ) ) { 510 510 return $r; 511 511 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin-directory-compat.php
r4977 r5058 14 14 } 15 15 16 function compat_views() { 17 return array( self::COMPAT, 'reviews', 'active' ); 18 } 19 16 20 function compat_title() { 17 21 /* translators: %s: plugin title */ … … 24 28 } 25 29 26 function activ ity_title() {30 function active_title() { 27 31 /* translators: %s: plugin title */ 28 32 return sprintf( _x( '[%s] Recent Activity', 'plugin', 'wporg-forums' ), $this->title() ); … … 87 91 $faq = sprintf( '<a href="//wordpress.org/plugins/%s/faq/">%s</a>', esc_attr( $this->slug() ), __( 'Frequently Asked Questions', 'wporg-forums' ) ); 88 92 $support = sprintf( '<a href="//wordpress.org/support/plugin/%s/">%s</a>', esc_attr( $this->slug() ), __( 'Support Threads', 'wporg-forums' ) ); 89 $active = sprintf( '<a href="//wordpress.org/support/plugin/%s/active ">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) );93 $active = sprintf( '<a href="//wordpress.org/support/plugin/%s/active/">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) ); 90 94 $reviews = sprintf( '<a href="//wordpress.org/support/plugin/%s/reviews/">%s</a>', esc_attr( $this->slug() ), __( 'Reviews', 'wporg-forums' ) ); 91 95 $create = ''; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-theme-directory-compat.php
r4977 r5058 14 14 } 15 15 16 function compat_views() { 17 return array( self::COMPAT, 'reviews', 'active' ); 18 } 19 16 20 function compat_title() { 17 21 /* translators: %s: theme title */ … … 24 28 } 25 29 26 function activ ity_title() {30 function active_title() { 27 31 /* translators: %s: theme title */ 28 32 return sprintf( _x( '[%s] Recent Activity', 'theme', 'wporg-forums' ), $this->title() ); … … 82 86 $theme = sprintf( '<a href="//wordpress.org/themes/%s/">%s</a>', esc_attr( $this->slug() ), esc_html( $this->theme->post_title ) ); 83 87 $support = sprintf( '<a href="//wordpress.org/support/theme/%s/">%s</a>', esc_attr( $this->slug() ), __( 'Support Threads', 'wporg-forums' ) ); 84 $active = sprintf( '<a href="//wordpress.org/support/theme/%s/active ">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) );88 $active = sprintf( '<a href="//wordpress.org/support/theme/%s/active/">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) ); 85 89 $reviews = sprintf( '<a href="//wordpress.org/support/theme/%s/reviews/">%s</a>', esc_attr( $this->slug() ), __( 'Reviews', 'wporg-forums' ) ); 86 90 $create = '';
Note: See TracChangeset
for help on using the changeset viewer.