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 |
---|---|
965 | * - `rest_attachment_trashable` |
966 | * |
967 | * Pass false to disable Trash support for the post. |
968 | * |
969 | * @since 4.7.0 |
970 | * |
971 | * @param bool $supports_trash Whether the post type support trashing. |
972 | * @param WP_Post $post The Post object being considered for trashing support. |
973 | */ |
974 | $supports_trash = apply_filters( "rest_{$this->post_type}_trashable", $supports_trash, $post ); |
975 |
|
976 | if ( ! $this->check_delete_permission( $post ) ) { |
977 | return new WP_Error( |
978 | 'rest_user_cannot_delete_post', |
979 | __( 'Sorry, you are not allowed to delete this post.' ), |
980 | array( 'status' => rest_authorization_required_code() ) |
981 | ); |
982 | } |
983 |
|