Make WordPress Core

Ticket #26957: class-wp-plugins-list-table.diff

File class-wp-plugins-list-table.diff, 6.1 KB (added by nicole@…, 11 years ago)
  • wp-admin/includes/class-wp-plugins-list-table.php

     
    3939                global $status, $plugins, $totals, $page, $orderby, $order, $s;
    4040
    4141                wp_reset_vars( array( 'orderby', 'order', 's' ) );
    42 
    4342                $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                         */
    4451                        'all' => apply_filters( 'all_plugins', get_plugins() ),
    4552                        'search' => array(),
    4653                        'active' => array(),
     
    5461                $screen = $this->screen;
    5562
    5663                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                         */
    5772                        if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
    5873                                $plugins['mustuse'] = get_mu_plugins();
     74                        /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */
    5975                        if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
    6076                                $plugins['dropins'] = get_dropins();
    6177
     
    362378                } // end if $context
    363379
    364380                $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                 */
    365397                $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                 */
    366414                $actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
    367415
    368416                $class = $is_active ? 'active' : 'inactive';
     
    416464                                        }
    417465                                        if ( ! empty( $plugin_data['PluginURI'] ) )
    418466                                                $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                                         */
    420478                                        $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
    421479                                        echo implode( ' | ', $plugin_meta );
    422480
     
    424482                                        break;
    425483                                default:
    426484                                        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                                         */
    427494                                        do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
    428495                                        echo "</td>";
    429496                        }
     
    431498
    432499                echo "</tr>";
    433500
     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                 */
    434511                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                 */
    435525                do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status );
    436526        }
    437527}