Ticket #5607: remove_admin_notices12.diff
File remove_admin_notices12.diff, 5.8 KB (added by , 17 years ago) |
---|
-
wp-admin/edit-form-advanced.php
17 17 <div class="wrap"> 18 18 <?php 19 19 20 if ( 0 == $post_ID) {20 if (! isset($post_ID) || 0 == $post_ID) { 21 21 $form_action = 'post'; 22 22 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() 23 23 $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />"; … … 33 33 34 34 $form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />'; 35 35 36 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ).'" />';36 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. ((isset($post->to_ping)) ? attribute_escape( str_replace("\n", ' ', $post->to_ping) ) : '').'" />'; 37 37 38 if ( '' != $post->pinged) {38 if (isset($post->pinged) && '' != $post->pinged) { 39 39 $pings = '<p>'. __('Already pinged:') . '</p><ul>'; 40 40 $already_pinged = explode("\n", trim($post->pinged)); 41 41 foreach ($already_pinged as $pinged_url) { … … 53 53 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 54 54 <input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" /> 55 55 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" /> 56 <input type="hidden" name="post_author" value="<?php echo attribute_escape( $post->post_author); ?>" />56 <input type="hidden" name="post_author" value="<?php echo ( (isset($post->post_author)) ? attribute_escape( $post->post_author ) : ''); ?>" /> 57 57 <input type="hidden" id="post_type" name="post_type" value="post" /> 58 58 59 59 <?php echo $form_extra ?> … … 82 82 <?php echo $form_prevstatus ?> 83 83 84 84 <p class="submit"> 85 <?php if ( 'publish' == $post->post_status ) { ?>85 <?php if ( isset($post->post_status) && 'publish' == $post->post_status ) { ?> 86 86 <a href="<?php echo clean_url(get_permalink($post->ID)); ?>" class="view-link" target="_blank"><?php _e('View »'); ?></a> 87 <?php } elseif ( 'edit' == $action ) { ?>87 <?php } elseif ( isset($action) && 'edit' == $action ) { ?> 88 88 <a href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" class="view-link" target="_blank"><?php _e('Preview »'); ?></a> 89 89 <?php } ?> 90 90 <span id="autosave"></span> … … 104 104 <input name="referredby" type="hidden" id="referredby" value="<?php 105 105 if ( !empty($_REQUEST['popupurl']) ) 106 106 echo clean_url(stripslashes($_REQUEST['popupurl'])); 107 else if ( url_to_postid(wp_get_referer()) == $post_ID )107 else if ( isset($post_ID) && url_to_postid(wp_get_referer()) == $post_ID ) 108 108 echo 'redo'; 109 109 else 110 110 echo clean_url(stripslashes(wp_get_referer())); … … 113 113 <div id="tagsdiv" class="postbox"> 114 114 <h3><?php _e('Tags'); ?></h3> 115 115 <div class="inside"> 116 <p id="jaxtag"><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID); ?>" /></p>116 <p id="jaxtag"><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( (isset($post_ID)) ? $post_ID : null ); ?>" /></p> 117 117 <p id="tagchecklist"></p> 118 118 </div> 119 119 </div> … … 191 191 <div id="passworddiv" class="postbox"> 192 192 <h3><?php _e('Post Password') ?></h3> 193 193 <div class="inside"> 194 <input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" />194 <input name="post_password" type="text" size="13" id="post_password" value="<?php echo (! empty($post->post_password) ) ? attribute_escape( $post->post_password ) : ''; ?>" /> 195 195 </div> 196 196 </div> 197 197 198 198 <div id="slugdiv" class="postbox"> 199 199 <h3><?php _e('Post Slug') ?></h3> 200 200 <div class="inside"> 201 <input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />201 <input name="post_name" type="text" size="13" id="post_name" value="<?php echo ( ! empty($post->post_name) ) ? attribute_escape( $post->post_name ) : ''; ?>" /> 202 202 </div> 203 203 </div> 204 204 … … 217 217 <?php if ( current_user_can('edit_posts') ) : ?> 218 218 <div id="posttimestampdiv" class="postbox"> 219 219 <h3><?php _e('Post Timestamp'); ?></h3> 220 <div class="inside"><?php touch_time( ($action == 'edit')); ?></div>220 <div class="inside"><?php touch_time( ( ! empty($action) && $action == 'edit' ) ? true : false ); ?></div> 221 221 </div> 222 222 <?php endif; ?> 223 223 224 224 <?php 225 225 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM 226 if ( $post->post_author&& !in_array($post->post_author, $authors) )226 if ( ! empty($post->post_author) && !in_array($post->post_author, $authors) ) 227 227 $authors[] = $post->post_author; 228 228 if ( $authors && count( $authors ) > 1 ) : 229 229 ?> … … 239 239 240 240 </div> 241 241 242 <?php if ( 'edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?>242 <?php if (! empty($action) && 'edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?> 243 243 <input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php echo ( 'draft' == $post->post_status ) ? __('Delete this draft') : __('Delete this post'); ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> 244 244 <?php endif; ?> 245 245