WordPress.org

Make WordPress Core

Ticket #6313: wp-includes-taxonomy.diff

File wp-includes-taxonomy.diff, 652 bytes (added by mtekk, 14 years ago)

This fixes lilyfan's code to follow WP code conventions

  • taxonomy.php

     
    743743                        return 0;
    744744                $where = $wpdb->prepare( "t.term_id = %d", $term );
    745745        } else {
    746                 if ( '' === $term = sanitize_title($term) )
     746                if ( '' === $sanitized = sanitize_title($term) )
    747747                        return 0;
    748                 $where = $wpdb->prepare( "t.slug = %s", $term );
     748                if ( 'post_tag' === $taxonomy ) {
     749                        $where = $wpdb->prepare( "(t.slug = %s OR t.name = %s)", $sanitized , $term );
     750                } else {
     751                        $where = $wpdb->prepare( "t.slug = %s", $sanitized );
     752                }
    749753        }
    750754
    751755        if ( !empty($taxonomy) )