WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/05/2016 07:38:16 PM (4 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.
Merges [39506] onto 4.7 branch.
Fixes #39078 for 4.7.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/tests/phpunit/tests/ajax/CustomizeMenus.php

    r39138 r39507  
    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.