How to change the title url on the edit post screen?

I searched in various places and am battling to find the correct place or terms used for the following.

I am only using posts as an example.

When you view all posts in wp-admin you get the title of the post and below it the Edit, Quick Edit, Trash and Preview links. By using the post_row_actions action hook I can change the links below the title but not the link on the title itself.

Are there an alternate way to change the link on the post title to open a different url? or can I change it with the same hook?

I am developing front-end content management screen and want to point all edit links to point to the front of the website.

Many thanks 🙂

2 Answers
2

Use get_edit_post_link filter.

add_filter('get_edit_post_link', 'get_edit_post_link_178416', 99, 3);

function get_edit_post_link_178416($link, $post_id, $context) {
    $scr = get_current_screen();

    if ($scr->id == 'edit-post' && $context == 'display') {
        return 'http://google.com';
    } else {
        return $link;
    }
}

You can see it’s used here

Leave a Comment