From f20a82995d34b8717d11aa0085f05488089c6313 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 4 Oct 2016 16:11:39 -0700 Subject: [PATCH] Prevent extra section params from being passed along to previewUrl --- js/customize-post-section.js | 5 ++++- js/customize-posts.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/customize-post-section.js b/js/customize-post-section.js index 286b476..fa63193 100644 --- a/js/customize-post-section.js +++ b/js/customize-post-section.js @@ -254,7 +254,10 @@ sectionNavigationButton.on( 'click', function( event ) { event.preventDefault(); - api.previewer.previewUrl( api.Posts.getPreviewUrl( section.params ) ); + api.previewer.previewUrl( api.Posts.getPreviewUrl( { + post_id: section.params.post_id, + post_type: section.params.post_type + } ) ); } ); }, diff --git a/js/customize-posts.js b/js/customize-posts.js index b2a3c8a..b78e421 100644 --- a/js/customize-posts.js +++ b/js/customize-posts.js @@ -106,7 +106,7 @@ * @param {object} params - Query vars. * @param {number} params.post_id - Post ID. * @param {string} [params.post_type] - Post type. - * @param {boolean} [params.preview] - . + * @param {boolean} [params.preview] - Preview. * @return {string} Preview URL. */ component.getPostUrl = function getPostUrl( params ) {