Support » Plugin: Multiple Domain Mapping on Single Site » Preview Page Button On Second Domain

  • Resolved coxy17

    (@coxy17)


    Hi,

    I have found that when you go to preview a post using a second domain mapped to it, the preview button fails to load the correct page.

    This is the page url which should be loading
    e.g. 2019/06/guest-speakers-announced-for-fearne-cottons-happy-place-festival/?preview=true

    but instead the page loads like so
    2019/06/guest-speakers-announced-for-fearne-cottons-happy-place-festival/?preview_id=7788&preview_nonce=001e104fe4&post_format=standard&_thumbnail_id=7790&preview=true

    I have found a post which explains the issue https://wordpress.org/support/topic/previewpage-loads-with-new-url/ and wondered if there is a fix yet?

    I have managed to find a temporary fix by adapting @tenserd code but only going to keep this in my functions file if there is no fix being planned anytime soon?

    // Fix post preview button link to work with  Multiple Domain Mapping on Single Site Plugin
    function moogiet_fix_preview_link() {
    
    	$moogiet_path = get_permalink();
    	$moogiet_newurl = "$moogiet_path?preview=true";
    	return $moogiet_newurl;
    }
    
    add_filter( 'preview_post_link', 'moogiet_fix_preview_link',30 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.