WordPress.org

Make WordPress Core

Ticket #8050: 8050.patch

File 8050.patch, 698 bytes (added by kurtpayne, 3 years ago)

has_child_relationship()

  • wp-includes/taxonomy.php

     
    31383138} 
    31393139 
    31403140/** 
     3141 * Determine if the child is on the inheritence chain fom the given parent 
     3142 * @param int $parent the ID of the parent object 
     3143 * @param int $child the ID of the child object 
     3144 * @param string $object_type the relationship type (e.g. 'category') 
     3145 */ 
     3146function has_child_relationship( $parent, $child, $object_type ) { 
     3147        return in_array( $parent, get_ancestors( $child, $object_type ) ); 
     3148} 
     3149 
     3150/** 
    31413151 * Returns the term's parent's term_ID 
    31423152 * 
    31433153 * @since 3.1.0