Make WordPress Core


Ignore:
Timestamp:
08/08/2008 05:05:10 PM (17 years ago)
Author:
westi
Message:

Lots of fixes for Notices when WP_DEBUG is set. See #6669 props santosj.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r8577 r8589  
    11<?php
     2
     3if ( ! isset( $post_ID ) )
     4    $post_ID = 0;
    25
    36$action = isset($action) ? $action : '';
    47if ( isset($_GET['message']) )
    58    $_GET['message'] = absint( $_GET['message'] );
    6 $messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
     9$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
    710$messages[2] = __('Custom field updated.');
    811$messages[3] = __('Custom field deleted.');
     
    1518$notices[1] = __( 'There is an autosave of this post that is more recent than the version below.  <a href="%s">View the autosave</a>.' );
    1619
    17 if ( !isset($post_ID) || 0 == $post_ID ) {
     20if ( 0 == $post_ID ) {
    1821    $form_action = 'post';
    1922    $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
     
    5558<?php
    5659
    57 if ( !isset($post_ID) || 0 == $post_ID)
     60if ( 0 == $post_ID)
    5861    wp_nonce_field('add-post');
    5962else
     
    124127<?php endif; ?>
    125128<?php
    126 if ($post_ID) {
     129if ( 0 != $post_ID ) {
    127130    if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    128131        $stamp = __('Scheduled for:<br />%1$s at %2$s');
     
    168171?>
    169172<br class="clear" />
    170 <?php if ($post_ID): ?>
     173<?php if ( 0 != $post_ID ): ?>
    171174<?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
    172175    $last_user = get_userdata($last_id);
     
    186189
    187190<ul>
    188 <?php if ($post_ID): ?>
     191<?php if ( 0 != $post_ID ): ?>
    189192<li><a href="edit.php?p=<?php echo $post_ID ?>"><?php _e('See Comments on this Post') ?></a></li>
    190193<?php endif; ?>
     
    346349function post_password_meta_box($post) {
    347350?>
    348 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
     351<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php if ( isset( $post->post_password ) ) : echo attribute_escape( $post->post_password ); endif; ?>" /></p>
    349352<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
    350353<?php
     
    375378endif;
    376379
    377 if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
     380if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
    378381function post_revisions_meta_box($post) {
    379382    wp_list_post_revisions();
Note: See TracChangeset for help on using the changeset viewer.