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