How to redirect from wp-admin/edit.php to a frontend page for specific custom post type?

I’m building a very tiny web app based on WordPress.

For this, I have created a custom post type for the items users will be able to manage in the app.

I have created a very pretty, optimized overview page as a frontend page. However, to save development time, editing each item still takes place in the backend.

Some operations in the backend – namely, deleting an item – take the user to the items overview page in the backend (/wp-admin/edit.php?post_type=my_item_post_type) rather than my pretty frontend page.

I would like to prevent this, so that when the user is taken to /wp-admin/edit.php?post_type=my_item_post_type they will be redirected to the pretty frontend page.

Is there a hook I can utilize for this?

Read more here:: How to redirect from wp-admin/edit.php to a frontend page for specific custom post type?

Leave a Reply

Your email address will not be published. Required fields are marked *