Changeset 31992 for trunk/src/wp-admin/includes/class-wp-press-this.php
- Timestamp:
- 04/03/2015 01:33:30 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-press-this.php
r31930 r31992 149 149 150 150 if ( 'publish' === get_post_status( $post_id ) ) { 151 /** 152 * Filter the URL to redirect to when Press This saves. 153 * 154 * @since 4.2.0 155 * 156 * @param string $url Redirect URL. If `$status` is 'publish', this will be the post permalink. 157 * Otherwise, the post edit URL will be used. 158 * @param int $post_id Post ID. 159 * @param string $status Post status. 160 */ 161 $redirect = apply_filters( 'press_this_save_redirect', get_post_permalink( $post_id ), $post_id, $post['post_status'] ); 151 $redirect = get_post_permalink( $post_id ); 162 152 } else { 163 /** This filter is documented in wp-admin/includes/class-wp-press-this.php */ 164 $redirect = apply_filters( 'press_this_save_redirect', get_edit_post_link( $post_id, 'raw' ), $post_id, $post['post_status'] ); 165 } 166 167 wp_send_json_success( array( 'redirect' => $redirect ) ); 153 $redirect = false; 154 } 155 156 /** 157 * Filter the URL to redirect to when Press This saves. 158 * 159 * @since 4.2.0 160 * 161 * @param string $url Redirect URL. If `$status` is 'publish', this will be the post permalink. 162 * Otherwise, the post edit URL will be used. 163 * @param int $post_id Post ID. 164 * @param string $status Post status. 165 */ 166 $redirect = apply_filters( 'press_this_save_redirect', $redirect, $post_id, $post['post_status'] ); 167 168 if ( $redirect ) { 169 wp_send_json_success( array( 'redirect' => $redirect ) ); 170 } else { 171 wp_send_json_success( array( 'postSaved' => true ) ); 172 } 168 173 } 169 174 } … … 1340 1345 </div> 1341 1346 <div class="post-actions"> 1347 <span class="spinner"> </span> 1342 1348 <button type="button" class="button-subtle draft-button"><?php _e( 'Save Draft' ); ?></button> 1343 1349 <button type="button" class="button-subtle preview-button"><?php _e( 'Preview' ); ?></button>
Note: See TracChangeset
for help on using the changeset viewer.