[wp-trac] [WordPress Trac] #39388: Can't delete tags under custom taxonomies

WordPress Trac noreply at wordpress.org
Mon Mar 13 21:05:47 UTC 2017


#39388: Can't delete tags under custom taxonomies
-------------------------------+------------------------------
 Reporter:  contempoinc        |       Owner:
     Type:  defect (bug)       |      Status:  reopened
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Taxonomy           |     Version:  4.7
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by contempoinc):

 That was it, I do use the functions below on the frontend to order beds
 and baths with get_terms_orderby, I removed them and I'm able to delete
 the duplicates can you recommend a way to get this tweaked to work in
 4.7+?

 {{{#!php
 <?php
 /*-----------------------------------------------------------------------------------*/
 /* Order Beds by Number */
 /*-----------------------------------------------------------------------------------*/

 if(!function_exists('beds_terms_order_as_number')) {
         function beds_terms_order_as_number($order_by, $args,
 $taxonomies){

             $taxonomy_to_sort = "beds";

             if(in_array($taxonomy_to_sort, $taxonomies)){
                 $order_by .=  " * 1";
             }

             return $order_by;
         }
 }
 add_filter( 'get_terms_orderby', 'beds_terms_order_as_number', 10,  3);

 /*-----------------------------------------------------------------------------------*/
 /* Order Baths by Number */
 /*-----------------------------------------------------------------------------------*/

 if(!function_exists('baths_terms_order_as_number')) {
         function baths_terms_order_as_number($order_by, $args,
 $taxonomies){

             $taxonomy_to_sort = "baths";

             if(in_array($taxonomy_to_sort, $taxonomies)){
                 $order_by .=  " * 1";
             }

             return $order_by;
         }
 }
 add_filter( 'get_terms_orderby', 'baths_terms_order_as_number', 10,  3);
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39388#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list