wp set object terms vs wp set post terms

Right there is no big difference between them, actually wp_set_post_terms() uses wp_set_object_terms() but does few extra check for you. That’s also noted on wp_set_object_terms() Codex page: Perhaps the wp_set_post_terms() is a more useful function, since it checks the values​​, converting taxonomies separated by commas and validating hierarchical terms in integers. http://codex.wordpress.org/Function_Reference/wp_set_object_terms#Notes

Define page template in wp_insert_post

From the wp_insert_post() documentation, the page_template argument reads as follow: page_template: If post_type is ‘page’, will attempt to set the page template. On failure, the function will return either a WP_Error or 0, and stop before the final actions are called. If the post_type is not ‘page’, the parameter is ignored. You can set the … Read more

wp_insert_post add meta_input

meta_input is just a single-dimension array as key => value: ‘meta_input’ => array( ‘name’ => $post[‘name’], ‘city’ => $post[‘city’] ) tax_input is slightly different, with tax as key and an array of values: ‘tax_input’ => array( ‘taxonomy_name’ => array( ‘term’, ‘term2’, ‘term3’ ) ) Note that for tax_input to work, the user currently logged in … Read more

Is there a downside of using wp_defer_term_counting?

Here are some thoughts on the issue, but please note that this is by no means a conclusive answer as there may be some things I have overlooked however this should give you an insight to the potential gotchas. Yes, technically there could be consequences. Where calling wp_defer_term_counting(true) becomes truly beneficial is when for instance … Read more