Make WordPress Core


Ignore:
Timestamp:
03/26/2014 06:21:45 PM (10 years ago)
Author:
nacin
Message:

WP_Theme: Return false from the display() method when get() fails.

Fixes a potential warning on the themes page when the active theme is deleted.

fixes #26873.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme.php

    r27471 r27745  
    536536     *
    537537     * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
    538      * @return string String on success, false on failure.
     538     * @return string|bool String on success, false on failure.
    539539     */
    540540    public function get( $header ) {
     
    572572     * @param bool $markup Optional. Whether to mark up the header. Defaults to true.
    573573     * @param bool $translate Optional. Whether to translate the header. Defaults to true.
    574      * @return string Processed header, false on failure.
     574     * @return string|bool Processed header, false on failure.
    575575     */
    576576    public function display( $header, $markup = true, $translate = true ) {
    577577        $value = $this->get( $header );
     578        if ( false === $value ) {
     579            return false;
     580        }
    578581
    579582        if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) )
Note: See TracChangeset for help on using the changeset viewer.