[wp-trac] [WordPress Trac] #51593: Problem assigning tags

WordPress Trac noreply at wordpress.org
Wed Oct 21 21:47:38 UTC 2020


#51593: Problem assigning tags
--------------------------+------------------------------
 Reporter:  Colics        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  5.5.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by Colics):

 Solution
 in file wp-includes/taxonomy.php

 function term_exists( $term, $taxonomy = '', $parent = null ) {
 ...
 change line
 $orderby           = 'ORDER BY t.term_id ASC';
 with line
 $orderby           = 'ORDER BY CASE WHEN hex(t.name) = hex(%s) THEN 0 ELSE
 1 END, t.term_id ASC';

 How does this work?
 If he finds 100% equal, return it to the first one, if not then still
 according to the second criterion, ie. t.term_id ASC

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


More information about the wp-trac mailing list