Changeset 5059
- Timestamp:
- 03/03/2017 06:37:50 PM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r5058 r5059 10 10 abstract protected function reviews_title(); 11 11 abstract protected function active_title(); 12 abstract protected function unresolved_title(); 12 13 abstract protected function slug(); 13 14 abstract protected function title(); … … 183 184 $translation = $this->active_title(); 184 185 break; 186 case 'unresolved': 187 $translation = $this->unresolved_title(); 188 break; 185 189 } 186 190 … … 231 235 ); 232 236 break; 237 238 // Return unresolved topics from the support forum. 239 case 'unresolved' : 240 return array( 241 'post_parent' => $this->forum_id(), 242 'post_status' => 'publish', 243 'tax_query' => array( array( 244 'taxonomy' => $this->taxonomy(), 245 'field' => 'slug', 246 'terms' => $this->query[ $this->query_var() ], 247 ) ), 248 'meta_key' => 'topic_resolved', 249 'meta_type' => 'CHAR', 250 'meta_value' => 'no', 251 'meta_compare' => '=', 252 'show_stickies' => false, 253 'orderby' => 'ID', 254 ); 255 break; 233 256 } 234 257 return $retval; … … 358 381 359 382 public function add_rewrite_rules() { 360 $priority = 'top'; 361 362 $root_id = $this->compat(); 363 $root_var = $this->query_var(); 364 $review_id = 'reviews'; 365 $active_id = 'active'; 366 367 $support_rule = $this->compat() . '/([^/]+)/'; 368 $reviews_rule = $this->compat() . '/([^/]+)/' . $review_id . '/'; 369 $active_rule = $this->compat() . '/([^/]+)/' . $active_id . '/'; 383 $priority = 'top'; 384 385 $root_id = $this->compat(); 386 $root_var = $this->query_var(); 387 $review_id = 'reviews'; 388 $active_id = 'active'; 389 $unresolved_id = 'unresolved'; 390 391 $support_rule = $this->compat() . '/([^/]+)/'; 392 $reviews_rule = $this->compat() . '/([^/]+)/' . $review_id . '/'; 393 $active_rule = $this->compat() . '/([^/]+)/' . $active_id . '/'; 394 $unresolved_rule = $this->compat() . '/([^/]+)/' . $unresolved_id . '/'; 370 395 371 396 $feed_id = 'feed'; … … 394 419 add_rewrite_rule( $active_rule . $paged_rule, 'index.php?' . $view_id . '=' . $active_id . '&' . $root_var . '=$matches[1]&' . $paged_id . '=$matches[2]', $priority ); 395 420 add_rewrite_rule( $active_rule . $feed_rule, 'index.php?' . $view_id . '=' . $active_id . '&' . $root_var . '=$matches[1]&' . $feed_id . '=$matches[2]', $priority ); 421 422 // Add unresolved view rewrite rules. 423 add_rewrite_rule( $unresolved_rule . $base_rule, 'index.php?' . $view_id . '=' . $unresolved_id . '&' . $root_var . '=$matches[1]', $priority ); 424 add_rewrite_rule( $unresolved_rule . $paged_rule, 'index.php?' . $view_id . '=' . $unresolved_id . '&' . $root_var . '=$matches[1]&' . $paged_id . '=$matches[2]', $priority ); 425 add_rewrite_rule( $unresolved_rule . $feed_rule, 'index.php?' . $view_id . '=' . $unresolved_id . '&' . $root_var . '=$matches[1]&' . $feed_id . '=$matches[2]', $priority ); 396 426 } 397 427 … … 460 490 ) 461 491 ); 492 493 // Add unresolved topics view. 494 bbp_register_view( 495 'unresolved', 496 $this->unresolved_title(), 497 array( 498 'post_parent' => $this->forum_id(), 499 'post_status' => 'publish', 500 'tax_query' => array( array( 501 'taxonomy' => $this->taxonomy(), 502 'field' => 'slug', 503 'terms' => $this->slug(), 504 ) ), 505 'meta_key' => 'topic_resolved', 506 'meta_type' => 'CHAR', 507 'meta_value' => 'no', 508 'meta_compare' => '=', 509 'orderby' => 'ID', 510 'show_stickies' => false, 511 ) 512 ); 462 513 } 463 514 … … 478 529 case 'reviews' : 479 530 case 'active' : 531 case 'unresolved' : 480 532 $url = $wp_rewrite->root . $this->compat() . '/' . $this->slug() . '/' . $view; 481 533 break; … … 522 574 $r[1] = sprintf( $compat_breadcrumb, esc_html( $this->title() ) ); 523 575 524 if ( in_array( $view, array( 'reviews', 'active' ) ) ) {576 if ( in_array( $view, array( 'reviews', 'active', 'unresolved' ) ) ) { 525 577 $r[1] = sprintf( $compat_breadcrumb, sprintf( 526 578 '<a href="%s" class="bbp-breadcrumb-forum">%s</a>', … … 530 582 if ( 'reviews' == $view ) { 531 583 $r[2] = __( 'Reviews', 'wporg-forums' ); 584 } elseif ( 'active' == $view ) { 585 $r[2] = __( 'Active Topics', 'wporg-forums' ); 532 586 } else { 533 $r[2] = __( ' ActiveTopics', 'wporg-forums' );587 $r[2] = __( 'Unresolved Topics', 'wporg-forums' ); 534 588 } 535 589 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-performance-optimizations.php
r5011 r5059 215 215 } 216 216 217 if ( bbp_is_single_view() && ! in_array( bbp_get_view_id(), array( 'plugin', 'theme', 'reviews', 'active' ) ) ) {217 if ( bbp_is_single_view() && ! in_array( bbp_get_view_id(), array( 'plugin', 'theme', 'reviews', 'active', 'unresolved' ) ) ) { 218 218 $r['post_parent__not_in'] = array( Plugin::THEMES_FORUM_ID, Plugin::PLUGINS_FORUM_ID, Plugin::REVIEWS_FORUM_ID ); 219 219 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin-directory-compat.php
r5058 r5059 15 15 16 16 function compat_views() { 17 return array( self::COMPAT, 'reviews', 'active' );17 return array( self::COMPAT, 'reviews', 'active', 'unresolved' ); 18 18 } 19 19 … … 31 31 /* translators: %s: plugin title */ 32 32 return sprintf( _x( '[%s] Recent Activity', 'plugin', 'wporg-forums' ), $this->title() ); 33 } 34 35 function unresolved_title() { 36 /* translators: %s: plugin title */ 37 return sprintf( _x( '[%s] Unresolved Topics', 'plugin', 'wporg-forums' ), $this->title() ); 33 38 } 34 39 … … 88 93 } 89 94 90 $plugin = sprintf( '<a href="//wordpress.org/plugins/%s/">%s</a>', esc_attr( $this->slug() ), esc_html( $this->plugin->post_title ) ); 91 $faq = sprintf( '<a href="//wordpress.org/plugins/%s/faq/">%s</a>', esc_attr( $this->slug() ), __( 'Frequently Asked Questions', 'wporg-forums' ) ); 92 $support = sprintf( '<a href="//wordpress.org/support/plugin/%s/">%s</a>', esc_attr( $this->slug() ), __( 'Support Threads', 'wporg-forums' ) ); 93 $active = sprintf( '<a href="//wordpress.org/support/plugin/%s/active/">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) ); 94 $reviews = sprintf( '<a href="//wordpress.org/support/plugin/%s/reviews/">%s</a>', esc_attr( $this->slug() ), __( 'Reviews', 'wporg-forums' ) ); 95 $create = ''; 95 $plugin = sprintf( '<a href="//wordpress.org/plugins/%s/">%s</a>', esc_attr( $this->slug() ), esc_html( $this->plugin->post_title ) ); 96 $faq = sprintf( '<a href="//wordpress.org/plugins/%s/faq/">%s</a>', esc_attr( $this->slug() ), __( 'Frequently Asked Questions', 'wporg-forums' ) ); 97 $support = sprintf( '<a href="//wordpress.org/support/plugin/%s/">%s</a>', esc_attr( $this->slug() ), __( 'Support Threads', 'wporg-forums' ) ); 98 $active = sprintf( '<a href="//wordpress.org/support/plugin/%s/active/">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) ); 99 $unresolved = sprintf( '<a href="//wordpress.org/support/plugin/%s/unresolved/">%s</a>', esc_attr( $this->slug() ), __( 'Unresolved Topics', 'wporg-forums' ) ); 100 $reviews = sprintf( '<a href="//wordpress.org/support/plugin/%s/reviews/">%s</a>', esc_attr( $this->slug() ), __( 'Reviews', 'wporg-forums' ) ); 101 $create = ''; 96 102 97 103 $create_label = ''; … … 120 126 <li><?php echo $support; ?></li> 121 127 <li><?php echo $active; ?></li> 128 <li><?php echo $unresolved; ?></li> 122 129 <li><?php echo $reviews; ?></li> 123 130 <?php if ( $create ) : ?> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-theme-directory-compat.php
r5058 r5059 15 15 16 16 function compat_views() { 17 return array( self::COMPAT, 'reviews', 'active' );17 return array( self::COMPAT, 'reviews', 'active', 'unresolved' ); 18 18 } 19 19 … … 31 31 /* translators: %s: theme title */ 32 32 return sprintf( _x( '[%s] Recent Activity', 'theme', 'wporg-forums' ), $this->title() ); 33 } 34 35 function unresolved_title() { 36 /* translators: %s: theme title */ 37 return sprintf( _x( '[%s] Unresolved Topics', 'theme', 'wporg-forums' ), $this->title() ); 33 38 } 34 39 … … 84 89 85 90 public function do_topic_sidebar() { 86 $theme = sprintf( '<a href="//wordpress.org/themes/%s/">%s</a>', esc_attr( $this->slug() ), esc_html( $this->theme->post_title ) ); 87 $support = sprintf( '<a href="//wordpress.org/support/theme/%s/">%s</a>', esc_attr( $this->slug() ), __( 'Support Threads', 'wporg-forums' ) ); 88 $active = sprintf( '<a href="//wordpress.org/support/theme/%s/active/">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) ); 89 $reviews = sprintf( '<a href="//wordpress.org/support/theme/%s/reviews/">%s</a>', esc_attr( $this->slug() ), __( 'Reviews', 'wporg-forums' ) ); 90 $create = ''; 91 $theme = sprintf( '<a href="//wordpress.org/themes/%s/">%s</a>', esc_attr( $this->slug() ), esc_html( $this->theme->post_title ) ); 92 $support = sprintf( '<a href="//wordpress.org/support/theme/%s/">%s</a>', esc_attr( $this->slug() ), __( 'Support Threads', 'wporg-forums' ) ); 93 $active = sprintf( '<a href="//wordpress.org/support/theme/%s/active/">%s</a>', esc_attr( $this->slug() ), __( 'Active Topics', 'wporg-forums' ) ); 94 $unresolved = sprintf( '<a href="//wordpress.org/support/theme/%s/unresolved/">%s</a>', esc_attr( $this->slug() ), __( 'Unresolved Topics', 'wporg-forums' ) ); 95 $reviews = sprintf( '<a href="//wordpress.org/support/theme/%s/reviews/">%s</a>', esc_attr( $this->slug() ), __( 'Reviews', 'wporg-forums' ) ); 96 $create = ''; 91 97 92 98 $create_label = ''; … … 108 114 <li><?php echo $support; ?></li> 109 115 <li><?php echo $active; ?></li> 116 <li><?php echo $unresolved; ?></li> 110 117 <li><?php echo $reviews; ?></li> 111 118 <?php if ( $create ) : ?>
Note: See TracChangeset
for help on using the changeset viewer.