Changeset 23658
- Timestamp:
- 03/09/2013 03:52:27 AM (12 years ago)
- Location:
- trunk/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-plugins-list-table.php
r23563 r23658 54 54 $screen = $this->screen; 55 55 56 if ( ! is_multisite() || ( $screen->i s_network && current_user_can('manage_network_plugins') ) ) {56 if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) { 57 57 if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 58 58 $plugins['mustuse'] = get_mu_plugins(); … … 73 73 set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS ); 74 74 75 if ( ! $screen->i s_network) {75 if ( ! $screen->in_admin( 'network' ) ) { 76 76 $recently_activated = get_option( 'recently_activated', array() ); 77 77 … … 84 84 foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { 85 85 // Filter into individual sections 86 if ( is_multisite() && ! $screen->i s_network&& is_network_only_plugin( $plugin_file ) ) {86 if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) ) { 87 87 unset( $plugins['all'][ $plugin_file ] ); 88 } elseif ( ! $screen->i s_network&& is_plugin_active_for_network( $plugin_file ) ) {88 } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) { 89 89 unset( $plugins['all'][ $plugin_file ] ); 90 } elseif ( ( ! $screen->i s_network&& is_plugin_active( $plugin_file ) )91 || ( $screen->i s_network&& is_plugin_active_for_network( $plugin_file ) ) ) {90 } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) ) 91 || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) { 92 92 $plugins['active'][ $plugin_file ] = $plugin_data; 93 93 } else { 94 if ( ! $screen->i s_network&& isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?94 if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? 95 95 $plugins['recently_activated'][ $plugin_file ] = $plugin_data; 96 96 $plugins['inactive'][ $plugin_file ] = $plugin_data; … … 238 238 239 239 if ( 'active' != $status ) 240 $actions['activate-selected'] = $this->screen->i s_network? __( 'Network Activate' ) : __( 'Activate' );240 $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' ); 241 241 242 242 if ( 'inactive' != $status && 'recent' != $status ) 243 $actions['deactivate-selected'] = $this->screen->i s_network? __( 'Network Deactivate' ) : __( 'Deactivate' );244 245 if ( !is_multisite() || $this->screen->i s_network) {243 $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' ); 244 245 if ( !is_multisite() || $this->screen->in_admin( 'network' ) ) { 246 246 if ( current_user_can( 'update_plugins' ) ) 247 247 $actions['update-selected'] = __( 'Update' ); … … 270 270 echo '<div class="alignleft actions">'; 271 271 272 if ( ! $this->screen->i s_network&& 'recently_activated' == $status )272 if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' == $status ) 273 273 submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false ); 274 274 elseif ( 'top' == $which && 'mustuse' == $status ) … … 290 290 global $status; 291 291 292 if ( is_multisite() && ! $this->screen->i s_network&& in_array( $status, array( 'mustuse', 'dropins' ) ) )292 if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) ) 293 293 return; 294 294 … … 332 332 $description .= '<p>' . $plugin_data['Description'] . '</p>'; 333 333 } else { 334 if ( $screen->i s_network)334 if ( $screen->in_admin( 'network' ) ) 335 335 $is_active = is_plugin_active_for_network( $plugin_file ); 336 336 else 337 337 $is_active = is_plugin_active( $plugin_file ); 338 338 339 if ( $screen->i s_network) {339 if ( $screen->in_admin( 'network' ) ) { 340 340 if ( $is_active ) { 341 341 if ( current_user_can( 'manage_network_plugins' ) ) … … 356 356 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 357 357 } // end if $is_active 358 } // end if $screen->i s_network359 360 if ( ( ! is_multisite() || $screen->i s_network) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )358 } // end if $screen->in_admin( 'network' ) 359 360 if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) 361 361 $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>'; 362 362 } // end if $context 363 363 364 $prefix = $screen->i s_network? 'network_admin_' : '';364 $prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : ''; 365 365 $actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context ); 366 366 $actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context ); -
trunk/wp-admin/includes/screen.php
r23503 r23658 320 320 /** 321 321 * The help tab data associated with the screen, if any. 322 323 324 325 326 322 * 323 * @since 3.3.0 324 * @var array 325 * @access private 326 */ 327 327 private $_help_tabs = array(); 328 328 329 329 /** 330 330 * The help sidebar data associated with screen, if any. 331 331 * … … 333 333 * @var string 334 334 * @access private 335 335 */ 336 336 private $_help_sidebar = ''; 337 337 … … 377 377 private $_screen_settings; 378 378 379 379 /** 380 380 * Fetches a screen object. 381 382 381 * 382 * @since 3.3.0 383 383 * @access public 384 384 * 385 385 * @param string $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen. 386 386 * Defaults to the current $hook_suffix global. 387 387 * @return WP_Screen Screen object. 388 388 */ 389 389 public static function get( $hook_name = '' ) { 390 390 … … 428 428 $maybe = substr( $id, 5 ); 429 429 if ( taxonomy_exists( $maybe ) ) { 430 430 $id = 'edit-tags'; 431 431 $taxonomy = $maybe; 432 432 } elseif ( post_type_exists( $maybe ) ) { … … 434 434 $post_type = $maybe; 435 435 } 436 436 } 437 437 438 438 if ( ! $in_admin ) … … 481 481 break; 482 482 } 483 483 } 484 484 485 485 switch ( $base ) { … … 514 514 $id .= '-user'; 515 515 $base .= '-user'; 516 516 } 517 517 518 518 if ( isset( self::$_registry[ $id ] ) ) { … … 536 536 537 537 return $screen; 538 538 } 539 539 540 540 /**
Note: See TracChangeset
for help on using the changeset viewer.