How to update taxonomy custom field with wp_update_term()?

wp_update_term does not support custom fields so you will need to use update_term_meta instead. This stores values like this: update_term_meta( $term_id, $metakey, $metavalue ); Your code should look something like this: update_term_meta( 41, ‘clpr_store_url’, $url); update_term_meta( 41, ‘clpr_store_aff_url’, $url);

Set a cookie in WordPress, using a select form and Jquery

If you don’t give the cookie an expires time it will only be available during that session. You will also need to destroy an existing cookie if it is already set. jQuery(function() { jQuery(‘#categoriesform’).submit(function(e) { if (jQuery.cookie(‘my_cookie’) ) { jQuery.cookie( ‘my_cookie’, null) } jQuery.cookie(‘my_cookie’, ‘my_value’, { expires: 30 }); }); }); Have you tested to … Read more

How to overwrite a specific parameter in a core taxonomy?

Version 4.4 saw the introduction of the register_taxonomy_args filter in register_taxonomy() which you can use to filter the arguments used to register a taxonomy /** * Filter the arguments for registering a taxonomy. * * @since 4.4.0 * * @param array $args Array of arguments for registering a taxonomy. * @param array $object_type Array of … Read more

Sorting custom taxonomy causes menus error

Currently your code is modifying all term queries, both in the front-end and in the back-end. Each navigational menu is registered as a term in the nav_menu taxonomy, so when you visit the backend to work on the menus, those queries have been modified too by your code snippet. For example, I don’t see any … Read more

check if tag exists in wp database

I think you’re looking for term_exists function. Example Code: <?php $term = term_exists(‘tag1’, ‘post_tag’); if ($term !== 0 && $term !== null) { echo “‘tag1’ post_tag exists!”; } else { echo “‘tag1’ post_tag does not exist!”; } ?>

List taxonomy terms as links

My apologies. After some more searching, I found that I could pass the taxonomy as an argument in wp_list_categories. Here is the info via WordPress Codex.