Changeset 5248
- Timestamp:
- 04/05/2017 04:50:33 AM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php
r4390 r5248 30 30 // Fall through 31 31 32 // Although we no longer have a admin view, this capability is still used to determine if the current user is a committer/contributor. 32 33 case 'plugin_admin_view': 33 34 // Committers + Contributors. -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r5217 r5248 440 440 441 441 // Handle plugin admin requests 442 add_rewrite_rule( '^([^/]+)/ad min/?$', 'index.php?name=$matches[1]&plugin_admin=1', 'top' );442 add_rewrite_rule( '^([^/]+)/advanced/?$', 'index.php?name=$matches[1]&plugin_advanced=1', 'top' ); 443 443 444 444 // Handle the old plugin tabs URLs. … … 961 961 $vars[] = 'redirect_plugin'; 962 962 $vars[] = 'redirect_plugin_tab'; 963 $vars[] = 'plugin_ad min';963 $vars[] = 'plugin_advanced'; 964 964 965 965 return $vars; … … 1050 1050 } 1051 1051 1052 // Browse 404's 1053 if ( 'browse' === $path[2] ) { 1054 wp_safe_redirect( home_url( '/browse/featured/' ) ); 1055 die(); 1056 } 1057 1052 1058 // Otherwise, handle a plugin redirect. 1053 1059 if ( $path[2] && ( $plugin = self::get_plugin_post( $path[2] ) ) ) { … … 1072 1078 } 1073 1079 1074 // Filter access to the plugin administration area. Only certain users are allowed access.1075 if ( get_query_var( 'plugin_admin' ) &&1076 ! current_user_can(1077 'plugin_admin_view',1078 $post = Plugin_Directory::get_plugin_post( get_query_var( 'name' ) )1079 )1080 ) {1081 wp_safe_redirect( get_permalink( $post ) );1082 die();1083 }1084 1080 } 1085 1081 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-meta.php
r5210 r5248 73 73 <?php endif; ?> 74 74 75 <?php if ( current_user_can( 'plugin_admin_view', $post ) ) : ?>75 <?php if ( ! get_query_var( 'plugin_advanced' ) ) : ?> 76 76 <li class="hide-if-no-js"> 77 77 <?php 78 printf( __( 'Admin access: %s', 'wporg-plugins' ), 79 sprintf( '<strong><a class="plugin-admin" href="%s">%s</a></strong>', esc_url( get_permalink() . 'admin/' ), __( 'View Admin', 'wporg-plugins' ) ) 80 ); 78 printf( '<strong><a class="plugin-admin" href="%s">%s</a></strong>', esc_url( get_permalink() . 'advanced/' ), __( 'Advanced View', 'wporg-plugins' ) ); 81 79 ?> 82 80 </li> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
r5245 r5248 74 74 ) ); 75 75 76 if ( get_query_var( 'plugin_ad min' ) ) {76 if ( get_query_var( 'plugin_advanced' ) ) { 77 77 wp_enqueue_script( 'google-jsapi', 'https://www.google.com/jsapi', array(), false, true ); 78 78 wp_enqueue_script( 'wporg-plugins-stats', get_template_directory_uri() . '/js/stats.js', array( 'jquery', 'google-jsapi' ), '20170328', true ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar-advanced.php
r5243 r5248 15 15 ); 16 16 17 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Meta', array(), $widget_args ); 18 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Committers', array(), $widget_args ); 19 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Contributors', array(), array( 17 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Meta', array(), $widget_args ); 18 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Ratings', array(), $widget_args ); 19 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Support', array(), $widget_args ); 20 21 // If the user is not a contributor/committer for the plugin, we'll show the Donate metabox instead of the committer metabox. 22 if ( current_user_can( 'plugin_admin_view', $post ) ) { 23 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Committers', array(), $widget_args ); 24 } else { 25 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Donate', array(), $widget_args ); 26 } 27 28 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Contributors', array(), array( 20 29 'before_title' => '<h4 class="widget-title">', 21 30 'after_title' => '</h4>', -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
r5210 r5248 120 120 <div class="entry-content"> 121 121 <?php 122 if ( get_query_var( 'plugin_ad min' ) ) :123 get_template_part( 'template-parts/section-ad min' );122 if ( get_query_var( 'plugin_advanced' ) ) : 123 get_template_part( 'template-parts/section-advanced' ); 124 124 else: 125 125 $plugin_sections = Template::get_plugin_sections(); … … 148 148 get_template_part( 'template-parts/section' ); 149 149 endforeach; 150 endif; // plugin_ad min150 endif; // plugin_advanced 151 151 ?> 152 152 </div><!-- .entry-content --> … … 154 154 <div class="entry-meta"> 155 155 <?php 156 get_template_part( 'template-parts/plugin-sidebar', ( get_query_var( 'plugin_a dmin' ) ? 'admin' : '' ) );156 get_template_part( 'template-parts/plugin-sidebar', ( get_query_var( 'plugin_avanced' ) ? 'advanced' : '' ) ); 157 157 ?> 158 158 </div><!-- .entry-meta -->
Note: See TracChangeset
for help on using the changeset viewer.