I am currently using a headless WordPress with NextJS and making adjustments in custom plugin index.php file.
Within the admin, I am trying to create a better user experience for our content writers and I was able to get the post_row_actions hook to work in swapping out the the main domain...
I was also able to get the icon at the top to view the post with the new domain; however, I am unable to get the actual URL link when you click on it to use the new domain name....
The first screenshot is a popup if you click on the URL on the sidebar and that does not work.
The following code is used to adjust the top two screenshots:
function my_custom_sample_permalink($permalink) {
$new_permalink = str_replace(home_url(), 'https://preview.domain.com', $permalink);
// Return the modified permalink.
return $new_permalink;
}
add_filter('get_sample_permalink', 'my_custom_sample_permalink', 10, 1);
The problem that I am having is that the link outlined in the screenshot by black marker is NOT going to the preview.domain.com page, but is showing the correct domain on the link.