Ticket #6357: 6357-multitype.diff

File 6357-multitype.diff, 2.0 kB (added by andy, 5 months ago)

accept array of object_types

  • wp-includes/taxonomy.php

    old new  
    3434 * 
    3535 * @uses $wp_taxonomies 
    3636 * 
    37  * @param string $object_type Name of the type of taxonomy object 
     37 * @param array|string $object_type Name of the type of taxonomy object 
    3838 * @return array The names of all taxonomy of $object_type. 
    3939 */ 
    4040function get_object_taxonomies($object_type) { 
     
    4242 
    4343        $taxonomies = array(); 
    4444        foreach ( $wp_taxonomies as $taxonomy ) { 
    45                 if ( $object_type === $taxonomy->object_type
     45                if ( in_array($object_type, (array) $taxonomy->object_type)
    4646                        $taxonomies[] = $taxonomy->name; 
    4747        } 
    4848 
     
    141141 * @uses $wp_taxonomies Inserts new taxonomy object into the list 
    142142 * 
    143143 * @param string $taxonomy Name of taxonomy object 
    144  * @param string $object_type Name of the object type for the taxonomy object. 
     144 * @param array|string $object_type Name of the object type for the taxonomy object. 
    145145 * @param array|string $args See above description for the two keys values. 
    146146 */ 
    147147function register_taxonomy( $taxonomy, $object_type, $args = array() ) { 
     
    15561556 *      Passes, function params in same order. 
    15571557 * 
    15581558 * @param int|array $object_ids Single or list of term object ID(s) 
    1559  * @param string $object_type The taxonomy object type 
     1559 * @param array|string $object_type The taxonomy object type 
    15601560 */ 
    15611561function clean_object_term_cache($object_ids, $object_type) { 
    15621562        if ( !is_array($object_ids) ) 
     
    16521652 * @uses wp_get_object_terms() Used to get terms from the database to update 
    16531653 * 
    16541654 * @param string|array $object_ids Single or list of term object ID(s) 
    1655  * @param string $object_type The taxonomy object type 
     1655 * @param array|string $object_type The taxonomy object type 
    16561656 * @return null|bool Null value is given with empty $object_ids. False if 
    16571657 */ 
    16581658function update_object_term_cache($object_ids, $object_type) {