Make WordPress Core

Changeset 31112


Ignore:
Timestamp:
01/09/2015 10:27:05 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Avoid a PHP notice in _WP_Editors::wp_fullscreen_html() when no $post global is set.

props marcochiesi.
fixes #30071.

File:
1 edited

Legend:

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

    r30890 r31112  
    12521252        $width = $width + 22; // compensate for the padding and border
    12531253        $dfw_width = get_user_setting( 'dfw_width', $width );
    1254         $save = isset( $post->post_status ) && $post->post_status == 'publish' ? __('Update') : __('Save');
     1254        $save = $post && $post->post_status == 'publish' ? __('Update') : __('Save');
    12551255
    12561256        ?>
     
    13171317        <div id="wp-fullscreen-save">
    13181318            <input type="button" class="button button-primary right" value="<?php echo $save; ?>" onclick="wp.editor.fullscreen.save();" />
    1319             <span class="wp-fullscreen-saved-message"><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
     1319            <span class="wp-fullscreen-saved-message"><?php if ( $post && $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
    13201320            <span class="wp-fullscreen-error-message"><?php _e('Save failed.'); ?></span>
    13211321            <span class="spinner"></span>
Note: See TracChangeset for help on using the changeset viewer.