WordPress.org

Make WordPress Core

Ticket #16310: tax-labels.patch

File tax-labels.patch, 920 bytes (added by foofy, 7 years ago)

Casts $object->labels to array as it's what the functions expect it to be

  • wp-includes/post.php

     
    11701170 * @since 3.0.0
    11711171 */
    11721172function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
     1173       
     1174        $object->labels = (array) $object->labels;
    11731175
    11741176        if ( isset( $object->label ) && empty( $object->labels['name'] ) )
    11751177                $object->labels['name'] = $object->label;
  • wp-includes/taxonomy.php

     
    390390 */
    391391
    392392function get_taxonomy_labels( $tax ) {
     393        $tax->labels = (array) $tax->labels;
     394       
    393395        if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) )
    394396                $tax->labels['separate_items_with_commas'] = $tax->helps;
    395397