Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frontend preview link when snapshot is saved #57

Merged
merged 3 commits into from Jul 11, 2016

Conversation

Projects
None yet
3 participants
@westonruter
Copy link
Contributor

westonruter commented Jul 8, 2016

Initial state, preview icon links to previewUrl on the frontend without a snapshot UUUID:

image

Once a change is made, the preview link is hidden because the snapshot is not saved:

image

Once the snapshot is saved, the preview link appears, this time with the URL including the customize_snapshot_uuid:

image

Once published, the initial state is restored:

image

Note that plugins can override/rewrite the URL used that is used for the frontend preview link (such as pointing to another domain for a headless WP instance) by defining a validate method like so:

wp.customize.Snapshots.frontendPreviewUrl.validate = function( url ) {
    var urlParser = document.createElement( 'a' );
    urlParser.href = url;
    urlParser.hostname = 'some-other-frontend.example.com';
    return urlParser.href;
};
@coveralls

This comment has been minimized.

Copy link

coveralls commented Jul 8, 2016

Coverage Status

Coverage remained the same at 92.105% when pulling 5a74134 on feature/frontend-preview-link into 5dd4ed9 on develop.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jul 8, 2016

Coverage Status

Coverage remained the same at 92.105% when pulling ce29035 on feature/frontend-preview-link into 5dd4ed9 on develop.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jul 8, 2016

Coverage Status

Coverage remained the same at 92.105% when pulling 194c9de on feature/frontend-preview-link into 5dd4ed9 on develop.

@valendesigns valendesigns merged commit 04c80c0 into develop Jul 11, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@valendesigns valendesigns deleted the feature/frontend-preview-link branch Jul 11, 2016

@westonruter westonruter modified the milestone: 0.5.0 Aug 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.