Tag Info

Hot answers tagged

3

I was pretty sure of this, but the answer is—at least for now—a definitive no. There isn't an API call for it. To double-check, I asked core developer Andrew Nacin about this on Twitter. His response: term_taxonomy_id is, for the moment, essentially private. You should likely never have it to use it. It might be worth posting a second question about ...


2

Have you tried using the WP_Query class? You might find it's easier to use the built-in tools for this instead of a custom query from scratch. Something similar to the following should work for you: <?php $args = array( 'post_type' => 'recipe_cpt', 'tax_query' => array( array( 'taxonomy' => 'recipe_tx', 'field' => 'id', ...


1

The easiest way is to just create conditional statements checking for the term and wrapping it in a div of your choice. After you loop starts you could do something like: while ($list_query->have_posts()) : $list_query->the_post(); if( has_term( 'casegoods', 'tag-series' ) ) { echo '<div class="left-side">'; the_content(); echo ...


1

create_term as you can see in inline docs in code Fires immediately after a new term is created, before the term cache is cleaned So you can't prevent an event after that event already happen. To prevent a term is inserted you can use 'pre_insert_term' filter hook and return a WP_Error a 0 or an empty string. Example: add_filter( ...


1

create_term is only fired after the term has already been inserted, so returning false will do nothing. pre_insert_term appears to be the hook to use, as mentioned in the codex here. However, the specific hook seems undocumented, so you might have to play with it a bit.


1

Ok, I revisited this and revised my answer.. But like I said before: the hook you are (trying) to use won't/can't work for the purpose you are aiming for, simply because its only occurrence is in class-wp-posts-list-table.php, which nomen est omen is used to show the post list, the right place should be class-wp-terms-list-table.php. 1. What you ...



Only top voted, non community-wiki answers of a minimum length are eligible