Front end page submission form does not attach custom post type

First, you should change your input field names to something unique. category is a WordPress query var, so submitting a form with that field name may have unexpected results. That said, post_category is only for the category taxonomy, custom taxonomies should use the tax_input parameter. however… if this form is being submitted by users who … Read more

WordPress: insert a custom post type instance as an option for a custom taxonomy

Ok, so I’m feeling generous and will add another answer 🙂 This code will run every time a post is created or updated, and it will add a term to your teacher taxonomy with a name that is the same as the post title. add_action(‘save_post’, ‘my_create_teacher_term_from_post’); function my_project_updated_send_email($post_id){ /** Ensure that this is not a … Read more

Set the Title of a Custom Post Type by code as Author’s Username

There’s actually some cool filters that allow you to pre-populate the title field and editor field, the one we need is default_title. Once in the hook, we need to get our user and display the name: function post_author_title( $post_title, $post ) { if( $post->post_type == ‘your_post_type’ ) { $user = wp_get_current_user(); $post_title = $user->display_name; } … Read more