Disable the Custom Permalinks for *Multiple* post types
-
function yasglobal_exclude_post_types( $post_type ) { if ( $post_type == 'post' ) { return '__true'; } return '__false'; } add_filter( 'custom_permalinks_exclude_post_type', 'yasglobal_exclude_post_types');This code only works with 1 custom post type. I need to disable it from multiple post types – that is for page, post, team,faq, etc.. Using the code two times and change the post type does not work and gives an error, and site goes down.
I also tried $post_type == ‘post, team’ and $post_type == ‘post’, ‘team’ and they also break the website.
Is this possible?
Could you please provide a code example?
Thank you,
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Disable the Custom Permalinks for *Multiple* post types’ is closed to new replies.