Backend users list – add Woocommerce meta to table

All the code below is for your current theme functios.php file (but better use a child theme or a custom plugin). Step 1. Not sure if you figured out with adding the columns, but I will mention it too – use manage_users_columns hook. add_filter( ‘manage_users_columns’, ‘new_modify_user_table’ ); function new_modify_user_table( $columnnames ) { return array_slice( $columnnames, … Read more

How to add existing categories into a post using wp_insert_post

You can use wp_set_object_terms() to assign taxonomy terms to a post. wp_set_object_terms($post_id, $terms, $taxonomy, true); Where $terms – A single term slug, single term id, or array of either term slugs or ids. Will replace all existing related terms in this taxonomy. See documentation: https://codex.wordpress.org/Function_Reference/wp_set_object_terms Edit: In your case, it will look like: wp_set_object_terms($post_id, array(2,3,4,5), … Read more