Make WordPress Core


Ignore:
Timestamp:
08/28/2015 03:38:26 AM (9 years ago)
Author:
SergeyBiryukov
Message:

In get_post_type_labels(), ensure that filtered labels contain all required default values.

fixes #33543.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-functions.php

    r33759 r33776  
    13381338    $post_type = $post_type_object->name;
    13391339
     1340    $default_labels = clone $labels;
     1341
    13401342    /**
    13411343     * Filter the labels of a specific post type.
     
    13501352     * @param object $labels Object with labels for the post type as member variables.
    13511353     */
    1352     return apply_filters( "post_type_labels_{$post_type}", $labels );
     1354    $labels = apply_filters( "post_type_labels_{$post_type}", $labels );
     1355
     1356    // Ensure that the filtered labels contain all required default values.
     1357    $labels = (object) array_merge( (array) $default_labels, (array) $labels );
     1358
     1359    return $labels;
    13531360}
    13541361
Note: See TracChangeset for help on using the changeset viewer.