mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Posts, Post Types: Don't add a trailing number when there is a unique post parent.
WordPress tries to avoid an issue where slugs might match an existing slug of a page/post. If we are in a hierarchical post type, there will be a level, and we can leave it the same. Props stormrockwell, SergeyBiryukov, terriann, tubys, jeremyfelt, Daschmi, MaximeCulea, knutsp, whyisjake. Fixes #51147. See also #44112 and #45260. git-svn-id: https://develop.svn.wordpress.org/trunk@51855 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -736,6 +736,9 @@ function avoid_blog_page_permalink_collision( $data, $postarr ) {
|
||||
if ( ! is_main_site() ) {
|
||||
return $data;
|
||||
}
|
||||
if ( isset( $data['post_parent'] ) && $data['post_parent'] ) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
$post_name = $data['post_name'];
|
||||
$c = 0;
|
||||
|
||||
Reference in New Issue
Block a user