In the code you posted, the filter ctc_post_type_item_args
gets applied to the $args
array before it is passed into register_post_type()
.
Putting a function into your themes functions.php
and hooking it to the filter should do the trick:
function wpse_191003_ctc_post_type_item_args( $args ) {
$args['rewrite']['slug'] = "your_new_slug";
return $args;
}
add_filter( 'ctc_post_type_item_args', 'wpse_191003_ctc_post_type_item_args' );
Related Posts:
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Change custom post type slug from plugin options
- How to target a specific custom post type post and its all children and grandchildren?
- WordPress page not showing up – replaced with last 10 posts?
- Custom permalink rewrite rules – how do I fix this?
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Is it possible to use a post name in a custom post slug?
- Set URL link to featured image of custom post type
- Child post with numeric only slug keeps redirecting to parent
- How to add a post slug to a url?
- Change CPT archive title
- AJAX load more for different custom post type loops
- PHP variable not regenerating when publishing multiple posts at the same time
- On update or create post redirect to current post position in list
- I need to add endpoint for wordpress categories
- Adding Post id to the end of slug in a Custom Post Type
- Remove the parent slug in a CPT URL
- Permalink for a custom post type isn’t working and I don’t know why
- Custom rewrite url category
- Featured image overlay when changing post status
- get_post_meta not working on publishing
- Index page with the same id as the slug
- Redirect 404 page with ID in slug to associated page with same ID in slug
- WordPress wrapped added a span tag to every single p tag
- ACF field key/value to show on taxonomy list
- Re-registering a custom post type not working (not showing up)
- Display featured image from one CPT within another CPT query
- How can I make the slug of the taxonomy also the slug of the custom post
- Query taxonomy of taxonomy of custom post type
- Assign same parrent Page to pages AND custom post types
- Best way to style first post differently?
- Allow duplicate slugs for custom post type with taxonomies
- How to make custom posts types display when published for the future
- Nested Custom Post Type or Custom Post Type Parents?
- How to rewrite url for any specific taxonomy?
- Programmatically rewriting slug through functions.php but returns 404
- Create a custom php page and load it at a specific slug
- Custom Post Type with Same Page URL
- create a new page from a custom post type similar to an authors page
- CPT archive admin menu label
- Anon function and add_meta_box
- Hide a widget inside a div on specific type of post
- How to prevent a CPT’s slug and page slug from conflicting with each other?
- Custom Post Slug same as Parents Category Slug
- Shortcode not working with post counter
- Changing default ‘posts’ parameters with register_post_type_args
- Multiple (two) category postings on the same page.
- Removed custom post type slug but not working for child pages
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Cannot save CPT meta box
- Including taxonomy term before post type breaks top level pages
- Allow users to create posts without logging in?
- How to change permalink to include custom post type
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Add term to custom post type on draft
- Can slugs from posts and custom post types conflict?
- How to assign classes to all elements?
- next_/previous_post_link() `in_same_category` appears to fail when true
- Custom Post Type – Duplicate Page Slugs
- Want to be able to sign up subscribers as authors
- Load scripts based on post type
- Different Category system needed for the Custom Post Type
- Global custom meta box
- Redirect to another page using contact form 7? [closed]
- Template not working for the custom Post type
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- Remove permalink for custom post type
- categories should be available across all custom post types
- Auto Slug Generation for Custom Post type
- Warning: Invalid argument supplied for foreach() in post.php [closed]
- How to make a posttype show under a page hierarchy (example.com/page/posttype/entry)?
- Featured Image field not appearing in Custom post type
- Custom Post Type archive-{post-type}.php not working
- Custom post type single page (single-{CPT-name}) 404 when slug includes hyphens
- Post-thumbnail only for specific post-types?
- How do you create %post_type%/%postname%/ permalink structure?
- custom post type metaboxes not saving
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Enable taxonomies by post type in an array of CPTs
- Slug for custom post type
- Rename a slug label
- PHP question: how to combine syntax?
- Slug Confusion Between Post and Custom Post types?
- How to find a specific post_type using its “rewrite slug”?
- Loop increase number
- custom post for slider
- Different slug taxonomy for two different CPT
- ACF in wordpress
- How to add current custom taxonomy slug to body class
- Using page slug in wp_query
- Excerpt function for any content
- Assign category a default post type
- Navigate posts with different post type that are in the same categories
- List of all entries of custom-post-type: Add year-parameter?
- How can Custom Post Type and a page have the same slug?
- Add an Outside Wrapper to my Header and Make it Full Width
- Page Template Dropdown For Custom Post Types
- Showing custom post type categories in the menu