Ticket #26957: class-wp-plugins-list-table.2.diff
File class-wp-plugins-list-table.2.diff, 6.3 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/class-wp-plugins-list-table.php
39 39 global $status, $plugins, $totals, $page, $orderby, $order, $s; 40 40 41 41 wp_reset_vars( array( 'orderby', 'order', 's' ) ); 42 43 42 $plugins = array( 43 /** 44 * Filter the array of plugin files, which is the value of 45 * the 'all' key in the parent array. 46 * 47 * @since 3.0.2 48 * 49 * @param array $plugins Array of plugins where key is the plugin file 50 * path and the value is an array of the plugin data. 51 */ 44 52 'all' => apply_filters( 'all_plugins', get_plugins() ), 45 53 'search' => array(), 46 54 'active' => array(), … … 54 62 $screen = $this->screen; 55 63 56 64 if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) { 65 /** 66 * Filter whether to "show" advanced plugins. 67 * 68 * @since 3.0.2 69 * 70 * @param bool $show Whether to show the advanced plugins for the specified 71 * plugin type. Defaults to true. 72 * @param string $plugin_type Must be one of 'mustuse' or 'dropins'. 73 */ 57 74 if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 58 75 $plugins['mustuse'] = get_mu_plugins(); 76 /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */ 59 77 if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) 60 78 $plugins['dropins'] = get_dropins(); 61 79 … … 362 380 } // end if $context 363 381 364 382 $prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : ''; 383 /** 384 * Filter the list of default links. 385 * 386 * The dynamic portion of the hook name, $prefix, is either 387 * 'network_admin_' if the current screen is in the network admin, or 388 * '' if it is not. 389 * 390 * @since 3.0.3 391 * 392 * @param array $actions Array of link code, each keyed by the corresponding action. Links are 393 * keyed with 'deactivate', 'activate', 'edit', and 'delete'. 394 * @param string $plugin_file Path to the plugin file. 395 * @param array $plugin_data Array of plugin data. 396 * @param string $context The plugin context, one of 'active', 'inactive', 'recently_activated', 397 * 'upgrade', 'mustuse', 'dropins', 'search', or 'all'. 398 */ 365 399 $actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context ); 400 /** 401 * Filter the list of action links for the specified plugin. 402 * 403 * The dynamic portion of the hook name, $prefix, is either 'network_admin_' 404 * if the current screen is in the network admin, or '' if it is not. 405 * The dynamic portion of the hook name, $plugin_file, is the path to 406 * the plugin file, relative to the plugins directory. 407 * 408 * @since 3.0.3 409 * 410 * @param array $actions Array of link code, each keyed by the corresponding action. Links are 411 * keyed with 'deactivate', 'activate', 'edit', and 'delete'. 412 * @param string $plugin_file Path to the plugin file, relative to the plugins directory. 413 * @param array $plugin_data Array of plugin data. 414 * @param string $context The plugin context, one of 'active', 'inactive', 'recently_activated', 415 * 'upgrade', 'mustuse', 'dropins', 'search', or 'all'. 416 */ 366 417 $actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context ); 367 418 368 419 $class = $is_active ? 'active' : 'inactive'; … … 416 467 } 417 468 if ( ! empty( $plugin_data['PluginURI'] ) ) 418 469 $plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . esc_attr__( 'Visit plugin site' ) . '">' . __( 'Visit plugin site' ) . '</a>'; 419 470 /** 471 * Filter the plugin meta for the row. 472 * 473 * @since 3.0.2 474 * 475 * @param array $plugin_meta Array of plugin meta data. 476 * @param string $plugin_file Path to the plugin file, relative to the plugins directory. 477 * @param array $plugin_data Array of plugin data. 478 * @param string $status The plugin status, one of 'active', 'inactive', 'recently_activated', 479 * 'upgrade', 'mustuse', 'dropins', 'search', or 'all'. 480 */ 420 481 $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status ); 421 482 echo implode( ' | ', $plugin_meta ); 422 483 … … 424 485 break; 425 486 default: 426 487 echo "<td class='$column_name column-$column_name'$style>"; 488 /** 489 * Fires inside the td tag of the custom column. 490 * 491 * @since 3.0.2 492 * 493 * @param string $column_name The column name. 494 * @param string $plugin_file Path to the plugin file, relative to the plugins directory. 495 * @param array $plugin_data Array of plugin data. 496 */ 427 497 do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data ); 428 498 echo "</td>"; 429 499 } … … 431 501 432 502 echo "</tr>"; 433 503 504 /** 505 * Fires after the tr tag of the plugin row. 506 * 507 * @since 3.0.2 508 * 509 * @param string $plugin_file Path to the plugin file, relative to the plugins directory. 510 * @param array $plugin_data Array of plugin data. 511 * @param string $status The plugin status, one of 'active', 'inactive', 'recently_activated', 512 * 'upgrade', 'mustuse', 'dropins', 'search', or 'all'. 513 */ 434 514 do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status ); 515 /** 516 * Fires after the tr tag of the plugin row of the specified plugin. 517 * 518 * The dynamic portion of the hook name, $plugin_file, is the path to the plugin file, 519 * relative to the plugins directory. 520 * 521 * @since 3.0.2 522 * 523 * @param string $plugin_file Path to the plugin file, relative to the plugins directory. 524 * @param array $plugin_data Array of plugin data 525 * @param string $status The plugin status, one of 'active', 'inactive', 'recently_activated', 526 * 'upgrade', 'mustuse', 'dropins', 'search', or 'all'. 527 */ 435 528 do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status ); 436 529 } 437 530 }