WP native tag suggest metabox. How does it process tag id?
It just passes the tag names to wp_update_post(), which eventually calls wp_set_post_tags(), which eventually converts the names to term_ids, using term_exists().
It just passes the tag names to wp_update_post(), which eventually calls wp_set_post_tags(), which eventually converts the names to term_ids, using term_exists().
Combine multiple custom user taxonomy in single url
Fatal error: Call to undefined method stdClass::filter() in wp-includes\taxonomy.php on line 805
Call register_taxonomy() with ‘show_admin_column’ => TRUE and WordPress will create your columns automatically. This parameter was added in version 3.5. You don’t need a custom filter anymore. I have written a small plugin to demonstrate this case: t5-taxonomy-location. This is the registration code: protected function register_taxonomy() { $this->set_labels(); $args = array ( ‘labels’ => $this->labels, … Read more
If you want to apply the required attribute every time you use wp_categories_dropdown, use wp_dropdown_cats filter as suggested in other answers: add_filter( ‘wp_dropdown_cats’, ‘wp_dropdown_categories_required’ ); function wp_dropdown_categories_required( $output ){ return preg_replace( ‘^’ . preg_quote( ‘<select ‘ ) . ‘^’, ‘<select required ‘, $output ); } If you want to apply the required attribute only in … Read more
No luck by using plugin provided functions as it gets it’s id by $obj = get_queried_object(); To get the image I use this code snippet: $associations = taxonomy_image_plugin_get_associations(); $tt_id = absint( $taxonomy_term->term_id ); if ( array_key_exists( $tt_id, $associations ) ) { $image_id = absint( $associations[ $tt_id ] ); } $image = wp_get_attachment_image( $image_id, ‘thumbnail’ );
How do I list terms of a custom taxonomy at i.e. domain.com/brands/
I would use in this case two custom taxonomies: hotel-country stars both none-hierarchical then your query would be as simple as for example hotel in uk with 2 stars: $args = array( ‘post_type’ => ‘hotel’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘hotel-country’, ‘field’ => ‘slug’, ‘terms’ => array( ‘uk’ ), ), array( … Read more
I guess this function is what you are looking for -> get_ancestors()
Filter pre_get_posts: add_filter( ‘pre_get_posts’, ‘wpse_98213_add_post_types_to_tax_query’ ); /** * Let WP search for custom post types on taxonomy archives. * * @wp-hook pre_get_posts * @param object $query * @return object */ function wpse_98213_add_post_types_to_tax_query( $query ) { if ( ! is_main_query() or ! is_tax( ‘your_taxonomy_name’ ) ) return $query; $query->set( ‘post_type’, array ( ‘portfolio’, ‘post’ ) ); … Read more