Adding parent and child options to an already registered custom post type

WordPress

Paste the following code into your theme’s functions file.

add_filter( 'register_post_type_args', 'customize_service_post_type_labels', 10, 2 );
function customize_service_post_type_labels( $args, $post_type ) {
	// Let's make sure that we're customizing the post type we really need
	if ( $post_type !== 'destinations' ) {
		return $args;
	}

	// Add new arguments
	$args['hierarchical'] = true;
	$args['supports'] = array( 'title', 'editor', 'page-attributes' );

	return $args;
}