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 |
---|---|
154 | /** |
155 | * Filters the post data of a Press This post before saving/updating. |
156 | * |
157 | * The {@see 'side_load_images'} action has already run at this point. |
158 | * |
159 | * @since 4.5.0 |
160 | * |
161 | * @param array $post_data The post data. |
162 | */ |
163 | $post_data = apply_filters( 'press_this_save_post', $post_data ); |
164 |
|
165 | $updated = wp_update_post( $post_data, true ); |
166 |
|
167 | if ( is_wp_error( $updated ) ) { |
168 | wp_send_json_error( array( 'errorMessage' => $updated->get_error_message() ) ); |
169 | } else { |
170 | if ( isset( $post_data['post_format'] ) ) { |
171 | if ( current_theme_supports( 'post-formats', $post_data['post_format'] ) ) { |
172 | set_post_format( $post_id, $post_data['post_format'] ); |