Modify Term Update Redirection

I agree with you, it’s somewhat an unexpected user experience, when you’re redirected after updating a term. Additionally there seems to be no error handling on the form itself, if you try to make some errors, like deleting the term name and slug, it will not show any errors, just ignore your changes and redirect. … Read more

Widget to display custom taxonomy tag cloud

Don’t know of any but you can easily create your own: <?php add_action(“widgets_init”, array(‘Widget_Custom_tax_tag_cloud’, ‘register’)); class Widget_Custom_tax_tag_cloud { function control(){ echo ‘No control panel’; } function widget($args){ echo $args[‘before_widget’]; echo $args[‘before_title’] . ‘Your widget title’ . $args[‘after_title’]; $cloud_args = array(‘taxonomy’ => ‘Your taxonomy here’); wp_tag_cloud( $cloud_args ); echo $args[‘after_widget’]; } function register(){ register_sidebar_widget(‘Widget name’, array(‘Widget_Custom_tax_tag_cloud’, … Read more

Taxonomy terms sort by… Last name!

You can try the MySQL function SUBSTRING_INDEX() within the get_terms_orderby filter: /** * Order by the last word in the term name * @link https://wordpress.stackexchange.com/a/195039/26350 */ add_filter( ‘get_terms_orderby’, function( $orderby, $args ) { if( isset( $args[‘orderby’] ) && ‘wpse_last_word’ === $args[‘orderby’] ) $orderby = ” SUBSTRING_INDEX( t.name, ‘ ‘, -1 ) “; return $orderby; }, … Read more

Query Custom Post Type taxonomy type based on page

To make that more efficient, instead of arguing the current page slug, you just place the current slug as the tax_query’s terms value. Something like: global $post; $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘books’, ‘post_status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘book_category’, ‘field’ => ‘slug’, ‘terms’ => $post->post_name, // which’d be … Read more

How to group meta boxes on the post edit page

Thanks for the hint Bainternet, indeed this is very easy to implement with jQuery. Example (the four meta boxes are closed for clarity) : Here’s what I did : var $j = jQuery.noConflict(); $j(document).ready(function() { $j(“#side-sortables”).append(‘<div id=”container_div” class=”postbox meta-box-sortables ui-sortable”><div class=”handlediv” title=”Click to toggle.”><br></div><h3 class=”hndle”><span>Container Meta Box</span></h3><div id=”container_inside” class=”inside”></div></div>’); $j(“#my_metabox_div”).appendTo(“#container_inside”); $j(“#my_other_metabox_div”).appendTo(“#container_inside”); etc… }); I added … Read more

wp_set_object_terms() — prevent overwrite?

wp_set_object_terms() has a fourth argument called append. Setting that to true during the call should add the term without unsetting the already set terms. wp_set_object_terms( $post_id, ‘add_this_term’, ‘in_this_taxonomy’, true);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)