Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: show_advanced_plugins

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
115                 * The $type parameter allows you to differentiate between the type of advanced
116                 * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'.
117                 *
118                 * @since 3.0.0
119                 *
120                 * @param bool   $show Whether to show the advanced plugins for the specified
121                 *                     plugin type. Default true.
122                 * @param string $type The plugin type. Accepts 'mustuse', 'dropins'.
123                 */
124                if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) {
125                     $plugins['mustuse'] = get_mu_plugins();
126                }
127
128                /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */
129                if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) {
130                     $plugins['dropins'] = get_dropins();
131                }
132
133                if ( current_user_can( 'update_plugins' ) ) {
134                     $current = get_site_transient( 'update_plugins' );
135                     foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
136                          if ( isset( $current->response[ $plugin_file ] ) ) {
137                               $plugins['all'][ $plugin_file ]['update'] = true;
138                               $plugins['upgrade'][ $plugin_file ]       = $plugins['all'][ $plugin_file ];