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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
172                 * Filters the URL to redirect to when Press This saves.
173                 *
174                 * @since 4.2.0
175                 *
176                 * @param string $url     Redirect URL. If `$status` is 'publish', this will be the post permalink.
177                 *                        Otherwise, the default is false resulting in no redirect.
178                 * @param int    $post_id Post ID.
179                 * @param string $status  Post status.
180                 */
181                $redirect = apply_filters( 'press_this_save_redirect', $redirect, $post_id, $post_data['post_status'] );
182
183                if ( $redirect ) {
184                     wp_send_json_success( array( 'redirect' => $redirect, 'force' => $forceRedirect ) );
185                } else {
186                     wp_send_json_success( array( 'postSaved' => true ) );
187                }
188           }
189      }
190