{"id":49684,"date":"2016-07-15T06:05:59","date_gmt":"2016-07-15T06:05:59","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/customizer-browser-history\/"},"modified":"2017-11-09T07:27:46","modified_gmt":"2017-11-09T07:27:46","slug":"customizer-browser-history","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/customizer-browser-history\/","author":186678,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.5.2","stable_tag":"0.5.2","tested":"4.9.29","requires":"4.7","requires_php":"","requires_plugins":"","header_name":"Customizer Browser History","header_author":"Weston Ruter, XWP","header_description":"","assets_banners_color":"8bc1d6","last_updated":"2017-11-09 07:27:46","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/xwp\/wp-customizer-browser-history","header_author_uri":"https:\/\/make.xwp.co\/","rating":5,"author_block_rating":0,"active_installs":10,"downloads":3634,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"2"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1462693","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1462693","resolution":"256x256","location":"assets"},"icon.svg":{"filename":"icon.svg","revision":"1462693","resolution":"","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1462693","resolution":"1544x500","location":"assets"},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1462693","resolution":"772x250","location":"assets"},"banner.svg":{"filename":"banner.svg","revision":"1462693","resolution":"","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","0.1.1","0.2.0","0.3.0","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5","0.4.6","0.4.7","0.5.0","0.5.1","0.5.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2757,2768],"plugin_category":[43],"plugin_contributors":[78438,78325],"plugin_business_model":[],"class_list":["post-49684","plugin","type-plugin","status-publish","hentry","plugin_tags-customize","plugin_tags-customizer","plugin_category-customization","plugin_contributors-westonruter","plugin_contributors-xwp","plugin_committers-westonruter"],"banners":{"banner":"https:\/\/ps.w.org\/customizer-browser-history\/assets\/banner-772x250.png?rev=1462693","banner_2x":"https:\/\/ps.w.org\/customizer-browser-history\/assets\/banner-1544x500.png?rev=1462693","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/customizer-browser-history\/assets\/icon.svg?rev=1462693","icon":"https:\/\/ps.w.org\/customizer-browser-history\/assets\/icon.svg?rev=1462693","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p><em>This is a feature plugin intended to implement <a href=\"https:\/\/core.trac.wordpress.org\/ticket\/28536\">#28536<\/a>: Add browser history and deep linking for navigation in Customizer preview<\/em><\/p>\n\n<p>This plugin keeps the Customizer URL in the browser updated with current previewed URL as the <code>url<\/code> query param and current expanded panel\/section\/control as <code>autofocus<\/code> params. This allows for bookmarking and also the ability to reload and return go the same view (which is great for developers), including which device you are previewing (desktop, tablet, or mobile). Not only will the URL be kept in sync with the current customizer UI, but new browser history entries will be added as you navigate around the site in the preview (via <code>history.pushState()<\/code>), allowing you to use the back\/forward buttons as you would normally when browsing the site outside the customizer. The scroll position for each previewed URL is tracked as well, so that when you navigate back\/forward the scroll position will be restored, just as happens when browsing the site outside the customizer preview. Restoring the scroll position also works when reloading the customizer, as the position is persisted in a <code>scroll<\/code> query parameter: again, this is extremely useful during development.<\/p>\n\n<p>This plugin complements well the <a href=\"https:\/\/github.com\/xwp\/wp-customize-snapshots\">Customize Snapshots<\/a> plugin which allows you to save your Customizer state in a shapshot\/changeset with an associated UUID that also gets added to the browser URL in the Customizer.<\/p>\n\n<p>For example, if you load the Customizer and then click the \u201cSite Identity\u201d section, the URL will be replaced to add <code>autofocus[section]=title_tagline<\/code>.<\/p>\n\n<p>If you navigate into the nav menus panel, open a menu section, and then expand a nav menu item control, then the URL will have these <code>autofocus<\/code> params added:<\/p>\n\n<pre>\nautofocus[panel]=nav_menus&amp;autofocus[section]=nav_menu[87]&amp;autofocus[control]=nav_menu_item[5123]\n<\/pre>\n\n<p>And while these changes to the <code>autofocus<\/code> params are being made in the browser's URL as the Customizer UI is interacted with, if you navigate to another page in the preview the <code>url<\/code> parameter will also be replaced to reflect the new preview URL.<\/p>\n\n<p>Note that the <code>url<\/code> param will be URL-encoded. So a typical Customizer URL would get updated to look like:<\/p>\n\n<pre>\nhttp:\/\/example.com\/wp-admin\/customize.php?url=http%3A%2F%2Fexample.com%2Fsample-page%2F&amp;autofocus[panel]=widgets&amp;autofocus[section]=sidebar-widgets-sidebar-1&amp;autofocus[control]=widget_text[10]&amp;device=mobile&amp;scroll=200\n<\/pre>\n\n<p>The plugin will also persist the scroll position from the frontend to preview frame in the Customizer after clicking the \u201cCustomize\u201d link in the frontend admin bar. This ensures you can quickly start editing whatever you were looking at the moment you clicked Customize, and it makes the Customizer load from the frontend in a more seamless way.<\/p>\n\n<p>Additionally, as you navigate around the Customizer preview, the close link in the Customizer controls pane will keep updating to point to the same URL that you are previewing, along with persisting the scroll position. In this way, whenever you close the Customizer via this link the user experience is that the Customizer sidebar is just removed, similar to as if they clicked the \u201cHide Controls\u201d link at the bottom of the sidebar. This behavior is only active if the user had clicked the Customize link from the frontend. If they clicked Customize from the admin, then the Close link will remain linking back to the admin page they came from. Note that for responsive themes like Twenty Seventeen, the synced scroll position between the frontend and backend won't always appear seamless since the Customizer controls panel being expanded causes the element dimensions in the preview to change.<\/p>\n\n<p><strong>Development of this plugin is done <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\">on GitHub<\/a>. Pull requests welcome. Please see <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/issues\">issues<\/a> reported there before going to the <a href=\"https:\/\/wordpress.org\/support\/plugin\/customizer-browser-history\">plugin forum<\/a>.<\/strong><\/p>\n\n<!--section=changelog-->\n<h4>0.5.2<\/h4>\n\n<ul>\n<li>Prevent autofocus params for themes panel and its sections from being included during theme switch. See <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/issues\/22\">#22<\/a>.<\/li>\n<li>Only remove parent construct autofocus params if child is defined statically; ensures that lazy-loaded children can be autofocused.<\/li>\n<li>Remove code now irrelevant as of WordPress 4.7.<\/li>\n<li>Bump minimum WordPress requirement to 4.7.<\/li>\n<li>Bump tested to 4.9.<\/li>\n<\/ul>\n\n<h4>0.5.1<\/h4>\n\n<p>Fix reference to <code>package.json<\/code> which is not included in build.<\/p>\n\n<h4>0.5.0<\/h4>\n\n<p>Persist scroll position and previewed URL between frontend and customizer preview. See <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/pull\/20\">#20<\/a>.<\/p>\n\n<h4>0.4.7<\/h4>\n\n<p>Prevent dropping non-home initial <code>url<\/code> param when loading customizer. See <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/pull\/19\">#19<\/a>.<\/p>\n\n<h4>0.4.6<\/h4>\n\n<p>Fix compatibility with WordPress 4.6. See <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/pull\/17\">#17<\/a>.<\/p>\n\n<h4>0.4.5<\/h4>\n\n<p>Ensure <code>changeset_uuid<\/code> param is added to <code>customize.php<\/code> URL if state is dirty OR the changeset post exists. PR <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/pull\/16\">#16<\/a>.<\/p>\n\n<h4>0.4.4<\/h4>\n\n<p>Only include one <code>autofocus<\/code> param. If <code>autofocus[control]<\/code> is present, skip including <code>autofocus[section]<\/code> (since implied). Likewise, if <code>autofocus[section]<\/code> is present, also exclude its containing <code>autofocus[panel]<\/code> since it is also implied. By only including one <code>autofocus<\/code> param the URL bar is less cluttered, but also an issue is fixed where focus may not reliably be added due to apparent inconsistencies in which construct is autofocused first (the control should really be the last to get focus).<\/p>\n\n<h4>0.4.3<\/h4>\n\n<p>Send scroll message to previewer to fix 4.7 scroll position.<\/p>\n\n<h4>0.4.2<\/h4>\n\n<p>Misc cleanup and improve integration with WP 4.7.<\/p>\n\n<h4>0.4.1<\/h4>\n\n<p>Fixed issue whereby an expanded widget control could persist its <code>autofocus<\/code> param when another section is expanded.<\/p>\n\n<h4>0.4.0<\/h4>\n\n<ul>\n<li>Added persistence of <code>scroll<\/code> position when navigating back\/forward in the preview and when reloading the customizer.<\/li>\n<li>Renamed the <code>customize_previewed_device<\/code> query param to just <code>device<\/code>.<\/li>\n<li>Improved the building of the URL query params to omit any params that are the same as the defaults, so <code>device=desktop<\/code> and <code>scroll=0<\/code> should not be shown, nor should a <code>url<\/code> that points to the home URL.<\/li>\n<li>Fixed dropping of value-less query params, e.g. <code>customize.php?debug<\/code><\/li>\n<\/ul>\n\n<h4>0.3.0<\/h4>\n\n<ul>\n<li>Add back\/forward browser history for navigation in the Customizer preview. See <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/issues\/2\">#2<\/a>, PR <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/pull\/8\">#8<\/a>.<\/li>\n<li>Eliminate initial insertion of <code>url<\/code> and <code>customize_previewed_device<\/code> params when same as default.<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<p>Persist the device being previewed (desktop, tablet, mobile) in the URL via a new <code>customize_previewed_device<\/code> query param. See <a href=\"https:\/\/github.com\/xwp\/wp-customizer-browser-history\/issues\/3\">#3<\/a>.<\/p>\n\n<h4>0.1.1<\/h4>\n\n<p>Remove <code>autofocus[control]<\/code> when there is not a section expanded, such as when a widget is expanded when the sidebar section is collapsed.<\/p>\n\n<h4>0.1.0<\/h4>\n\n<p>Initial release.<\/p>","raw_excerpt":"Sync browser URL in Customizer with current preview URL and focused panels, sections, and controls.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/49684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=49684"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/westonruter"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=49684"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=49684"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=49684"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=49684"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=49684"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=49684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}