WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
5484 | switch ( $type ) { |
5485 | case 'plugin': |
5486 | if ( ! current_user_can( 'update_plugins' ) ) { |
5487 | $error_message = __( 'Sorry, you are not allowed to modify plugins.' ); |
5488 | wp_send_json_error( array( 'error' => $error_message ) ); |
5489 | } |
5490 |
|
5491 | $option = 'auto_update_plugins'; |
5492 | /** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ |
5493 | $all_items = apply_filters( 'all_plugins', get_plugins() ); |
5494 | break; |
5495 | case 'theme': |
5496 | if ( ! current_user_can( 'update_themes' ) ) { |
5497 | $error_message = __( 'Sorry, you are not allowed to modify themes.' ); |
5498 | wp_send_json_error( array( 'error' => $error_message ) ); |
5499 | } |
5500 |
|
5501 | $option = 'auto_update_themes'; |
5502 | $all_items = wp_get_themes(); |