Make WordPress Core

Ticket #55358: 55358.patch

File 55358.patch, 704 bytes (added by lgadzhev, 4 years ago)

Adding $parent to the query when $term is used as an int

  • src/wp-includes/taxonomy.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
    a b  
    15561556                if ( 0 === $term ) {
    15571557                        return 0;
    15581558                }
     1559
     1560                if ( ! empty( $taxonomy ) && is_numeric( $parent ) ) {
     1561                        $defaults['parent'] = (int) $parent;
     1562                }
     1563
    15591564                $args  = wp_parse_args( array( 'include' => array( $term ) ), $defaults );
    15601565                $terms = get_terms( $args );
    15611566        } else {