Issues with Indexing When Using Custom save_post function
-
We are using Relevanssi on an intranet we built. Some of our users wanted to ability to be redirected to the front-end of a page after making an edit (rather than staying in the editor view). The users that are using this function are not having their changes/edits indexed upon saving the page. Here is the function we are using:
function checkEditUpdateRedirect( $post_id ) { $accepted_statuses = ['publish', 'private']; if ( ! in_array( get_post_status( $post_id ), $accepted_statuses ) ) return; $user = wp_get_current_user(); $redirectToFront = (int) get_field( 'redirect_after_edits', 'user_'. $user->ID ); if ( $redirectToFront ) { wp_redirect( get_permalink( $post_id ) ); exit; } } add_action( 'save_post', 'checkEditUpdateRedirect' );
I have tried triggering indexing before the wp_redirect, but nothing I am doing seems to be working. Any help or tips you can offer? At what point is the indexing triggered when a post is saved/updated? I seem to be bypassing it somehow.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Issues with Indexing When Using Custom save_post function’ is closed to new replies.