- Timestamp:
- 11/17/2022 06:13:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r54754 r54855 660 660 ) { 661 661 /* 662 * `wp_unique_post_slug()` returns the same 663 * slug for 'draft' or 'pending' posts. 662 * `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts. 664 663 * 665 * To ensure that a unique slug is generated, 666 * pass the post data with the 'publish' status. 664 * To ensure that a unique slug is generated, pass the post data with the 'publish' status. 667 665 */ 668 666 $prepared_post->post_name = wp_unique_post_slug( … … 863 861 864 862 /* 865 * `wp_unique_post_slug()` returns the same 866 * slug for 'draft' or 'pending' posts. 867 * 868 * To ensure that a unique slug is generated, 869 * pass the post data with the 'publish' status. 863 * `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts. 864 * 865 * To ensure that a unique slug is generated, pass the post data with the 'publish' status. 870 866 */ 871 867 if ( ! empty( $post->post_name ) && in_array( $post_status, array( 'draft', 'pending' ), true ) ) { 872 868 $post_parent = ! empty( $post->post_parent ) ? $post->post_parent : 0; 873 $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, 'publish', $post->post_type, $post_parent ); 869 $post->post_name = wp_unique_post_slug( 870 $post->post_name, 871 $post->ID, 872 'publish', 873 $post->post_type, 874 $post_parent 875 ); 874 876 } 875 877
Note: See TracChangeset
for help on using the changeset viewer.