Error [Column ‘post_title’ cannot be null] when title is disabled for Custom post type

I would suggest the following improvements for better code readability and to make it easier to maintain later. Assuming you’ve removed title from your custom post type using the following function : remove_post_type_support( ‘slider’, ‘title’ ) Now if you use name=”post_title” instead of name=”wys_slider_title” WordPress will still use it and update the post title accordingly. … Read more

Automatically assign posts with custom field to taxonomy term

The following should do what you need: add_action (‘save_post_site-members’, ‘add_term’) ; function add_term ($post_id) { if (defined (‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) { return ; } $meta_key = ‘aab-ew-select-visible’ ; $tax = ‘test-all-members-cpt-tax’ ; $term_slug = ‘test-all-members-ew-tax’ ; $meta_value = isset ($_REQUEST[$meta_key]) ? $_REQUEST[$meta_key] : ” ; if (‘display’ == $meta_value) { $term = get_term_by (‘slug’, $term_slug, … Read more