I'm working with a child theme. Main theme has a custom post type called "Place". I need to change that into "Location". However, I changed all levels using wp_post_types object.
Now I need to change endpoint. In frontend, URLs are look like domain.com/place/a-permalink. I need to change that into domain.com/location/a-permalink
But I cannot change slug.
I checked some questions like this one. But cannot understand how to use with custom post type. I badly need your advice.
EDIT: In Parent theme, post type was registered this way:
register_post_type( "$custom_post_type",
array( 'label' => CUSTOM_MENU_TITLE,
'labels' => array( 'name' => CUSTOM_MENU_NAME,
'singular_name' => CUSTOM_MENU_SIGULAR_NAME,
'add_new' => CUSTOM_MENU_ADD_NEW,
'add_new_item' => CUSTOM_MENU_ADD_NEW_ITEM,
'edit' => CUSTOM_MENU_EDIT,
'edit_item' => CUSTOM_MENU_EDIT_ITEM,
'new_item' => CUSTOM_MENU_NEW,
'view_item' => CUSTOM_MENU_VIEW,
'search_items' => CUSTOM_MENU_SEARCH,
'not_found' => CUSTOM_MENU_NOT_FOUND,
'not_found_in_trash' => CUSTOM_MENU_NOT_FOUND_TRASH ),
'public' => true,
'can_export' => true,
'show_ui' => true, // UI in admin panel
'_builtin' => false, // It's a custom post type, not built in
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
'menu_icon' => get_bloginfo('template_url').'/images/favicon.ico',
'hierarchical' => false,
'rewrite' => array("slug" => "$custom_post_type"), // Permalinks
'query_var' => "$custom_post_type", // This goes to the WP_Query schema
'supports' => array( 'title',
'author',
'excerpt',
'thumbnail',
'comments',
'editor',
'trackbacks',
'custom-fields',
'revisions') ,
'show_in_nav_menus' => true ,
'taxonomies' => array("$custom_cat_type","$custom_tag_type")
)
);
AND AGAIN, I CANNOT TOUCH PARENT THEME, I HAVE TO DO EVERYTHING FROM CHILD THEME.
register_post_type()