Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#14079 closed defect (bug) (fixed)

wp_unique_post_slug does not work properly for hierarchical custom posts types

Reported by: chowmein's profile chowmein Owned by:
Milestone: 3.0.1 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Custom post types with hierarchy set to true, will still have a suffix appended to the slug if the post name is not unique.

Currently you will have to apply the 'hierarchical_post_types' filter to your custom post type. However, this should be done through register_post_type().

Change History (3)

#1 @nacin
15 years ago

  • Milestone changed from Unassigned to 3.0.1
	$hierarchical_post_types = apply_filters( 'hierarchical_post_types', array( 'page' ) );

Should become:

	$hierarchical_post_types = get_post_types( 'hierarchical', true );

If we don't want to completely remove the filter, we should array_merge them.

#2 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15348]) Use get_post_types() to create list of hierarchical post types. fixes #14079 for 3.1

#3 @ryan
15 years ago

(In [15349]) Use get_post_types() to create list of hierarchical post types. fixes #14079 for 3.0.1

Note: See TracTickets for help on using tickets.