Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: press_this_save_redirect

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
190                 * Filters the URL to redirect to when Press This saves.
191                 *
192                 * @since 4.2.0
193                 *
194                 * @param string $url     Redirect URL. If `$status` is 'publish', this will be the post permalink.
195                 *                        Otherwise, the default is false resulting in no redirect.
196                 * @param int    $post_id Post ID.
197                 * @param string $status  Post status.
198                 */
199                $redirect = apply_filters( 'press_this_save_redirect', $redirect, $post_id, $post_data['post_status'] );
200
201                if ( $redirect ) {
202                     wp_send_json_success( array( 'redirect' => $redirect, 'force' => $forceRedirect ) );
203                } else {
204                     wp_send_json_success( array( 'postSaved' => true ) );
205                }
206           }
207      }
208