Changeset 2798 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
- Timestamp:
- 03/24/2016 10:38:23 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r2792 r2798 31 31 add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) ); 32 32 add_action( 'save_post_plugin', array( $this, 'save_plugin_post' ), 10, 2 ); 33 add_filter( 'views_edit-plugin', array( $this, 'list_table_views' ) );34 33 35 34 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); … … 163 162 $where = preg_replace( "!\s(\S+\.post_name IN .+?)\s*AND\s*(\s\S+\.post_author.+?)AND!i", ' ( $1 OR $2 ) AND', $where ); 164 163 return $where; 165 }166 167 public function list_table_views( $views ) {168 global $wp_query;169 if ( current_user_can( 'plugin_edit_others' ) ) {170 return $views;171 }172 // The only view the user needs, is their own.173 return array(174 sprintf(175 '<a href="#" class="current">%s</a>',176 sprintf(177 _nx(178 'Mine <span class="count">(%s)</span>',179 'Mine <span class="count">(%s)</span>',180 $wp_query->found_posts,181 'posts',182 'wporg-posts'183 ),184 number_format_i18n( $wp_query->found_posts )185 )186 )187 );188 164 } 189 165
Note: See TracChangeset
for help on using the changeset viewer.