Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: all_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

Line Code
5364      switch ( $type ) {
5365           case 'plugin':
5366                if ( ! current_user_can( 'update_plugins' ) ) {
5367                     $error_message = __( 'Sorry, you are not allowed to modify plugins.' );
5368                     wp_send_json_error( array( 'error' => $error_message ) );
5369                }
5370
5371                $option = 'auto_update_plugins';
5372                /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
5373                $all_items = apply_filters( 'all_plugins', get_plugins() );
5374                break;
5375           case 'theme':
5376                if ( ! current_user_can( 'update_themes' ) ) {
5377                     $error_message = __( 'Sorry, you are not allowed to modify themes.' );
5378                     wp_send_json_error( array( 'error' => $error_message ) );
5379                }
5380
5381                $option    = 'auto_update_themes';
5382                $all_items = wp_get_themes();