Skip to content

Custom Preview Links #4555

@fishstix81

Description

@fishstix81

In the current Wordpress editor, you can currently filter the preview link to be your own custom link using preview_post_link. Its appears that Gutenberg does not currently support this and does not appear to offer a hook to change this. From what I can see it appears tied to this method in /store/selectors.js

export function getEditedPostPreviewLink( state ) {
    const link = state.currentPost.link;
    if ( ! link ) {
        return null;
    }

    return addQueryArgs( link, { preview: 'true' } );
}

If I am reading this correctly, this gets the current link from the state obj and appends the preview query arg.

It would be great if this value came from PHP or a JS hook was offered to override this selection. Since we are currently developing our new site using Gutenberg, I have no choice but to hack the JS.

If there is a hook, please drop me a line. #

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions