I saw this function in Revisions.php file,
wp_safe_redirect( admin_url( ‘post.php?action=edit&post=’ . $linkedPostId ) );
But I need to add this in theme functions.php file.
Do not want to make changes in the plugin.
Hello @rahulsatija, Jacob here.
I think it will be fair enough if we will add this hook on the next update.
Stay tuned. I will give you more information here soon.
Best regards.
Hello again.
New version 2.5.91 is ready to download.
We added filter hook for you.
It’s called tmc/revisionmanager/revisions/createLinkedPost/redirectUrl
and takes two parameters:
1) current redirect url
2) new post ID
Filter should return new redirect URL.
Best regards,
Jacob.
Thanks for the support.
Can you please sample code, how can I override this filter hook in my theme functions.php
I am trying but facing issue. Sample code can help me alot.
Thanks in Advance
This is sample code I am trying.
Please correct me.
add_filter( ‘tmc/revisionmanager/revisions/createLinkedPost/redirectUrl’, ‘revision_redirect’, 11, 2 );
function revision_redirect( $redirectUrl, $linkedPostId ) {
// your custom changes to $actions array HERE
// this will be executed after add_edit_address_subscription_action function
header(‘Location: index.php’);
exit;
}
function redirectUrlAfterRevisionManagerCreatesDraft( $url, $newPostId ){
return admin_url( '/my-awesome/admin/url/in/dashboard/area' );
}
add_filter( 'tmc/revisionmanager/revisions/createLinkedPost/redirectUrl', 'redirectUrlAfterRevisionManagerCreatesDraft', 10, 2 );
-
This reply was modified 6 years, 11 months ago by
themastercut.