Setting var of current post type
-
I am currently using code snippet to hide the title and editor in a custom post type. My only problem is I don’t want to add a new post type every time I want to add another post type. I got this working one post type or all them using ||. This is the function I am using. Does anyone know how I could get the current post type save it as a local var and then set it as the post type to remove support from.
add_action('init', 'my_rem_editor_from_post_type'); function my_rem_editor_from_post_type() { remove_post_type_support( 'cpt', 'editor'); remove_post_type_support('cpt', 'title'); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Setting var of current post type’ is closed to new replies.