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