You can redirect this way:
add_action( 'save_post', 'save_meta_values' );
public function save_meta_values( $post_id ) {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return $post_id;
}
// More code here ...
// Check if it's a custom post type names news_info
if ( 'news_info' === get_post_type( $post_id ) ) {
// Redirect to the CPT listing page
wp_redirect( admin_url( 'edit.php?post_type=product' ) );
exit;
}
return $post_id;
}
Related Posts:
- Redirect after deleting post and keep track of pagination
- How to access the thank you page from the single post?
- How do I change the author of a custom post type?
- How to add a button to custom post type’s posts-page
- Creating a custom public user page
- get_edit_post_link() not working as expected when passed id in plugin
- Is flush_rewrite_rules necessary when creating a custom post type? Why?
- Remove Slug from Custom Post Type results in 404
- Unable to filter on field on edit.php page
- Insert slider (Custom Post Type) into pages
- How do I create a custom post type for a training CMS in WordPress?
- WP Query group/order by category name
- Save or update data when custom post published
- Unable to get wp_redirect() working after adding a CPT via the front end
- Using posts and postmeta table to store custom Address Book Plugin data
- template_redirect not working, apparently for no reason
- How to add multiple featured image in meta box in post editor?
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- How do I set the link in the Custom Post Type admin menu?
- How to List Thumbnails based on Custom Categories
- Adding Meta Boxes while Registering a Post Type in a Class
- How to have the right design for a custom post type without accessing themes
- Dynamic Custom Post Type Plugin
- handling csv data with a custom post type
- Custom Post Type | Fatal Error on register_post_type()
- Set object terms not working on plugin activation
- Using custom page templates with plugin [duplicate]
- Custom Post Type rewrite
- Admin notice not displaying
- Custom Post Type: Upload Multiple Images
- Insert Multiple Post with Same Publish Button
- custom post type not showing in menu
- Adding a custom post type taxonomy template in plugin
- Plugin: register custom post types, child ready and performance best practices
- How to add a custom taxonomy to show up in a custom post type menu?
- Give a permalink to Custom Post Types without title
- Getting template_include to work when allow_url_include is off?
- Getting meta in editor plugin, and event triggering issue
- Custom Permalink to remove category word , keeping posts permalink with date?
- Form action/link to render a plugin in WordPress front-end
- How to use TinyMCE Editor for one of my custom post meta field?
- How to Create a WordPress Plugin With Custom Post Type/Custom Field Features?
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- Custom fields for custom post type
- Why does not this wp_redirect work in is_single()?
- Save Multiple Metabox values
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- post_parent in custom post type
- What’s an efficient way to change the post status of many posts at once?
- Dynamically insert code to custom post type loop
- How exclude or skip post type with get_next_post_link
- How do I add custom HTML to the content of an archive page’s posts?
- Unable to format dates to put in event calendar
- How to add query args to links to CPT admin submenu
- Dynamic assign a custom template to custom post type posts
- How to add and display custom content that is not a post
- Custom post type in Custom widget – $listItem
- Problem with adding custom post type meta to header by plugin
- Creating alternate meta box context locations
- Types plugin custom post add_action hooks
- Convert Custom Table Data Based Plugin To Be Searchable
- Limiting Amount of Posts in a Custom Post Type again
- Not Able to Add New Class To CPT Attachment Image
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- Orderby custom fields is not working
- Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?
- How to stop the custom post type URL from the google search?
- How to add a default predefined thumbnail when creating a brand new post?
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- URL issue retrieving Custom Post Types using Backbone JS API
- WordPress Custom Post Loop
- Changing CPT permalink
- Correct way adding External classes to Custom Post type and output their methods to template
- Get all posts by many custom post types
- ‘Simple’ Reservation System
- Warning , Use of undefined constant PLUGIN_PATH?
- Show Post columns to specific users on condition
- Error when moving custom post type to bin
- Admin metabox with custom post type dropdown option not update choosed input after saving
- Having issue on Loading Meta Data From CSV to CPT
- custom data model – link and populate from admin backend
- Custom Post type plugin is using theme single.php and style.css
- php output of generated custom metabox
- Redirect users in first login to a dynamic link
- call a function when insert and update a custom post type
- Can’t save custom post type fields
- Registering an optional custom post type from a plugin
- Shortcode error
- Generate custom RSS from a plugin
- Issue on Counting CPT’s Under Taxonomy Term
- Get term_id for each instance of custom taxonomy
- How to internationalize the sub menu name “categories” in Custom post type?
- Creating a Custom Post Type as a Plugin? Why?
- WordPress Roles
- Create settings page to enable or disable CPT
- How to filter custom post data with AJAX?
- get_post_types() is returning null
- How to consume external API from WordPress post editor and display the response data in the custom field?
- How to Insert Elementor Elements with CSS and JS into a Custom Post Type Using wp_insert_post()? [closed]