Make WordPress Core

Ticket #57923: 57923.diff

File 57923.diff, 1.2 KB (added by SergeyBiryukov, 15 months ago)
  • src/wp-includes/taxonomy.php

     
    27112711 * @param int              $object_id The object to relate to.
    27122712 * @param string|int|array $terms     A single term slug, single term ID, or array of either term slugs or IDs.
    27132713 *                                    Will replace all existing related terms in this taxonomy. Passing an
    2714  *                                    empty value will remove all related terms.
     2714 *                                    empty array will remove all related terms.
    27152715 * @param string           $taxonomy  The context in which to relate the term to the object.
    27162716 * @param bool             $append    Optional. If false will delete difference of terms. Default false.
    27172717 * @return array|WP_Error Term taxonomy IDs of the affected terms or WP_Error on failure.
     
    27252725                return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
    27262726        }
    27272727
     2728        if ( empty( $terms ) ) {
     2729                $terms = array();
     2730        }
     2731
    27282732        if ( ! is_array( $terms ) ) {
    27292733                $terms = array( $terms );
    27302734        }