Make WordPress Core


Ignore:
Timestamp:
12/05/2016 07:32:09 PM (5 years ago)
Author:
westonruter
Message:

Customize: Defer populating post_name for auto-draft posts in customized state until posts are published.

The ultimate post_name is stored in postmeta until the post is published. The get_page_by_path() function does not exclude auto-draft posts. Revert changes to wp_unique_post_slug() from [39411] which excluded auto-draft posts.

Props westonruter, dlh for testing, helen for testing.
See #38114, #38928.
Fixes #39078.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/CustomizeMenus.php

    r39138 r39506  
    602602        $this->assertEquals( 'Hello World', $post->post_title );
    603603        $this->assertEquals( 'post', $post->post_type );
    604         $this->assertEquals( 'hello-world', $post->post_name );
     604        $this->assertEquals( '', $post->post_name );
     605        $this->assertEquals( 'hello-world', get_post_meta( $post->ID, '_customize_draft_post_name', true ) );
    605606    }
    606607
Note: See TracChangeset for help on using the changeset viewer.