• Resolved rahulsatija

    (@rahulsatija)


    Dear Team

    I wan to know any hook or method that change redirect Url on clicking on “Create revision Draft” link below post list page.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter rahulsatija

    (@rahulsatija)

    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.

    Plugin Author themastercut

    (@themastercut)

    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.

    Thread Starter rahulsatija

    (@rahulsatija)

    Thanks Jacob

    For quick response.

    Plugin Author themastercut

    (@themastercut)

    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.

    Thread Starter rahulsatija

    (@rahulsatija)

    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

    Thread Starter rahulsatija

    (@rahulsatija)

    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;
    }

    Plugin Author themastercut

    (@themastercut)

    
    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 5 years, 5 months ago by themastercut.
    Thread Starter rahulsatija

    (@rahulsatija)

    Thanks team,

    That one is working.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Redirection url customization’ is closed to new replies.