The register_post_type_args
filter can be used to modify post type arguments:
add_filter( 'register_post_type_args', 'wpse247328_register_post_type_args', 10, 2 );
function wpse247328_register_post_type_args( $args, $post_type ) {
if ( 'portfolio' === $post_type ) {
$args['rewrite']['slug'] = 'stories';
}
return $args;
}
Related Posts:
- Create category only for custom post type
- Truncating custom fields
- Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts
- How to add an option page to custom post type?
- Custom post type permalink is doesn’t show in admin
- Custom Post Type with Input fields to seperate table on database.
- How Can I save multiple records in same meta key?
- Custom post type or just use custom fields
- Seperating custom post type comments from regular blog posts comments
- How to Programically add to the new WordPress menus
- What order? register_taxonomy() register_taxonomy_for_object_type() register_post_type()
- Creating a custom post type upon registration
- custom post type upcoming post and past post
- Showing Meta Data for Custom Post Types?
- How can I fix a slow redirect after form submit from frontend (no plugin)?
- WooCommerce – Show orders for a specific product ? [closed]
- Linking together two different custom post types
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Custom role capabilities to administrator not taking effect (no plugin)
- Menu highlight custom post type archive
- How to get a list of post types that “support” various things such as page-attributes?
- Show Post Count of a Category
- Set Custom Image Size Just For Specific Custom Post Type
- Function to get permalink of custom post type archives?
- I changed post_type and now I receive 404 errors
- How to determine if custom post type showing on archive templates
- Filter the content from a post globally immediately after is fetched from the database
- Add multiple custom post type issue
- Filter categories of posts with checkboxes
- Post Object Filter by Custom Field, not title (ACF)
- Shortcode for display posts on home page show only one post
- Bizarre Permalinks Issue: 404 Errors Everywhere
- Only show posts from a certain category?
- Custom Post Type as Home Page Problem
- Pagination for custom php code
- Shops listing (CPT VS Plugin)
- Customize Query for post
- Correct classes for WordPress menu items
- How can I see a list of my Custom Post Types of the last term I was in?
- Front end editor to pending post(for contributors)
- Adding user capabilities for a custom taxonomy of a custom post type for a custom user
- delete_published_posts does not work
- Removing custom post type slug from URL
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- Custom Post Type not showing in Rest API on Multisite
- Users create/join groups
- Redirect custom post type category to other custom post type category
- Rewrite URL of Custom Post Type for Jobs
- Single custom post type’s menu ancestor/parent is Posts archive page
- Want to be able to sign up subscribers as authors
- Advanced search form with filters for custom taxonomies
- Looking for Direction regarding Custom Posts
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Publish and save specific postmeta to a filtered post_type
- how to associate several authors to a custom post type
- Pagination 404 on Index with custom query
- Display custom taxonomy on my custom post type
- List Categories (wp_terms) and count posts
- get_post_types is not showing all registered posts
- Address as a content type post
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Add shortcode inside of the_content()
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Add more than one custom post type to wordpress home page post loop
- how to get options to choose post format in add new post
- Filtering Custom Post Type by Comparing Date and Two Meta Keys
- Using custom post types WordPress network
- Custom Posttype and menu classes
- Custom Attachment Type
- custom post type or taxonomy, which approach is better?
- Custom post type, permalink, add query variables problem
- Apply category query clause to posts of custom type
- Duplicate content problems after adding an archive page to the article’s post type
- Custom taxonomy returns 404 even with saving permalinks
- CPT relations use in permalinks under single post type
- Custom Post Type works when registered in functions.php but not when registered in plugin
- Custom post type shortcode with taxonomy attribute not working and no errors
- bad practice for Custom Post Type
- Redirect Custom Post Type from Child Taxonomies
- How to pass modified post to RSS feed?
- put a list of one post type in other post type to select from it and display selected item in second post type’s single page
- Meta_query by date for Events archive
- How to mark posts as visited
- Show tags of custom post types in WordPress
- WordPress get all post with like in terms [duplicate]
- Query Pulling the same post twice
- Templates list in “Page Attributes” metabox is inaccurate
- creating different edit screens for different roles
- wordpress form processing to custom post type not working
- Loop multiple taxonomy in custom post
- $post breaking container loop
- Custom Post Type as invoice or order template
- Pagination in custom loop for custom post type throwing 404 error
- Make each Value of custom field show related posts when clicked
- Two post types with same single template
- why get_post_meta is returning 0?
- How to create an upload page (front side)
- Get all active posts that are tied to a custom taxonomy for a custom post type
- get_the_post_navigation not working
- Sort ACF by custom taxonomy