Make WordPress Core

Ticket #43345: 43345.diff

File 43345.diff, 1.5 KB (added by dotancohen, 7 years ago)

Patch to resolve issue.

  • src/wp-includes/taxonomy.php

    diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
    index 92a4ee7..6b627b5 100644
    a b function has_term_meta( $term_id ) { 
    12891289 * @param int|string $term     The term to check. Accepts term ID, slug, or name.
    12901290 * @param string     $taxonomy The taxonomy name to use
    12911291 * @param int        $parent   Optional. ID of parent term under which to confine the exists search.
    1292  * @return mixed Returns null if the term does not exist. Returns the term ID
    1293  *               if no taxonomy is specified and the term ID exists. Returns
    1294  *               an array of the term ID and the term taxonomy ID the taxonomy
    1295  *               is specified and the pairing exists.
     1292 * @return string|array|null  Returns null if the term does not exist. Returns the term ID
     1293 *                             if no taxonomy is specified and the term ID exists. Returns
     1294 *                             an array of the term ID and the term taxonomy ID the taxonomy
     1295 *                             is specified and the pairing exists.
    12961296 */
    12971297function term_exists( $term, $taxonomy = '', $parent = null ) {
    12981298        global $wpdb;
    function term_exists( $term, $taxonomy = '', $parent = null ) { 
    13021302
    13031303        if ( is_int($term) ) {
    13041304                if ( 0 == $term )
    1305                         return 0;
     1305                        return null;
    13061306                $where = 't.term_id = %d';
    13071307                if ( !empty($taxonomy) )
    13081308                        return $wpdb->get_row( $wpdb->prepare( $tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy ), ARRAY_A );