Changeset 4202 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
- Timestamp:
- 10/08/2016 04:23:48 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r4201 r4202 50 50 add_action( 'template_redirect', array( $this, 'redirect_old_plugin_urls' ) ); 51 51 add_filter( 'query_vars', array( $this, 'filter_query_vars' ) ); 52 add_filter( 'single_term_title', array( $this, 'filter_single_term_title' ) ); 52 53 53 54 // oEmbed whitlisting. … … 201 202 'rewrite' => false, 202 203 'labels' => array( 203 'name' => __( ' Plugin Contributors', 'wporg-plugins' ),204 'singular_name' => __( ' Plugin Contributor', 'wporg-plugins' ),204 'name' => __( 'Authors', 'wporg-plugins' ), 205 'singular_name' => __( 'Author', 'wporg-plugins' ), 205 206 ), 206 207 'public' => true, … … 545 546 $wp_query->query_vars['order'] = 'ASC'; 546 547 548 // Treat it as a taxonomy query now, not the author archive. 549 $wp_query->is_author = false; 550 $wp_query->is_tax = true; 551 547 552 unset( $wp_query->query_vars['author_name'], $wp_query->query_vars['author'] ); 548 549 553 } 550 554 … … 704 708 705 709 return $vars; 710 } 711 712 /** 713 * Filters the term names for archive headers to be more useful. 714 * 715 * @param string $name The Term Name. 716 * @return string The Term Name. 717 */ 718 public function filter_single_term_title( $name ) { 719 $term = get_queried_object(); 720 if ( ! $term || ! isset( $term->taxonomy ) ) { 721 return $name; 722 } 723 724 switch ( $term->taxonomy ) { 725 case 'plugin_contributors': 726 $user = get_user_by( 'slug', $term->slug ); 727 $name = $user->display_name; 728 break; 729 } 730 731 return $name; 706 732 } 707 733
Note: See TracChangeset
for help on using the changeset viewer.