WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/18/2016 08:04:36 PM (5 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/adminbar.php

    r38708 r38810  
    551551        $this->assertNull( $node );
    552552    }
     553
     554    /**
     555     * @ticket 30937
     556     * @covers wp_admin_bar_customize_menu()
     557     */
     558    public function test_customize_link() {
     559        global $wp_customize;
     560        require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
     561        $uuid = wp_generate_uuid4();
     562        $this->go_to( home_url( "/?customize_changeset_uuid=$uuid" ) );
     563        wp_set_current_user( self::$admin_id );
     564
     565        $this->factory()->post->create( array(
     566            'post_type' => 'customize_changeset',
     567            'post_status' => 'auto-draft',
     568            'post_name' => $uuid,
     569        ) );
     570        $wp_customize = new WP_Customize_Manager( array(
     571            'changeset_uuid' => $uuid,
     572        ) );
     573        $wp_customize->start_previewing_theme();
     574
     575        set_current_screen( 'front' );
     576        $wp_admin_bar = $this->get_standard_admin_bar();
     577        $node = $wp_admin_bar->get_node( 'customize' );
     578        $this->assertNotEmpty( $node );
     579
     580        $parsed_url = wp_parse_url( $node->href );
     581        $query_params = array();
     582        wp_parse_str( $parsed_url['query'], $query_params );
     583        $this->assertEquals( $uuid, $query_params['changeset_uuid'] );
     584        $this->assertNotContains( 'changeset_uuid', $query_params['url'] );
     585    }
    553586}
Note: See TracChangeset for help on using the changeset viewer.