Customize: Implement customized state persistence with changesets.

Includes infrastructure developed in the Customize Snapshots feature plugin.

See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/

Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.


git-svn-id: https://develop.svn.wordpress.org/trunk@38810 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2016-10-18 20:04:36 +00:00
parent 2ba32a2d48
commit 83b059aa19
32 changed files with 4186 additions and 539 deletions
+33
View File
@@ -550,4 +550,37 @@ class Tests_AdminBar extends WP_UnitTestCase {
$this->assertNull( $node );
}
/**
* @ticket 30937
* @covers wp_admin_bar_customize_menu()
*/
public function test_customize_link() {
global $wp_customize;
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$uuid = wp_generate_uuid4();
$this->go_to( home_url( "/?customize_changeset_uuid=$uuid" ) );
wp_set_current_user( self::$admin_id );
$this->factory()->post->create( array(
'post_type' => 'customize_changeset',
'post_status' => 'auto-draft',
'post_name' => $uuid,
) );
$wp_customize = new WP_Customize_Manager( array(
'changeset_uuid' => $uuid,
) );
$wp_customize->start_previewing_theme();
set_current_screen( 'front' );
$wp_admin_bar = $this->get_standard_admin_bar();
$node = $wp_admin_bar->get_node( 'customize' );
$this->assertNotEmpty( $node );
$parsed_url = wp_parse_url( $node->href );
$query_params = array();
wp_parse_str( $parsed_url['query'], $query_params );
$this->assertEquals( $uuid, $query_params['changeset_uuid'] );
$this->assertNotContains( 'changeset_uuid', $query_params['url'] );
}
}