Tag Info

New answers tagged

0

The add_filter followed by remove_filter approach seems hacky, I prefer using a conditional approach like this: /** * Post type archives by month */ function kevinlearynet_getarchives_events( $sql_where, $r ) { // conditions for when you want to do this // (don't do it all the time) if ( is_post_type_archive( 'event' ) ) { $sql_where ...


1

There's a much simplier (and more secure way*) way than hiding the user interface (show_ui=false) and adding a custom metabox to only display terms. If you remove the capability of the user to manage terms, however, not only do you have a secure solution, but user interface takes care of itself. As part of the register_taxonomy() you can specify the ...


0

This code runs "wp_insert_term" only when needed (only when querying for all terms) for better performances register_taxonomy( 'categories', null, array( 'hierarchical' => true, 'labels' => array( 'name' => 'Categories' ), 'show_admin_column' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' ...



Top 50 recent answers are included