Changeset 11052 for trunk/wp-admin/includes/media.php
- Timestamp:
- 04/22/2009 12:24:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r11051 r11052 397 397 $errors[$attachment_id] = $post['errors']; 398 398 unset($post['errors']); 399 } else { 400 $errors = array(); 399 401 } 400 402 … … 430 432 } 431 433 432 return $errors;434 return isset($errors) ? $errors : ''; 433 435 } 434 436 … … 988 990 'input' => 'html', 989 991 'html' => "<input type='text' class='urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . attribute_escape($image_url) . "' /><br />", 990 'value' => $edit_post->post_url,992 'value' => isset($edit_post->post_url) ? $edit_post->post_url : '', 991 993 'helps' => __('Location of the uploaded file.'), 992 994 ) … … 1223 1225 $item .= "\t<input type='hidden' name='$name' id='$name' value='" . attribute_escape( $value ) . "' />\n"; 1224 1226 1225 if ( $post->post_parent < 1 && (int) $_REQUEST['post_id']) {1227 if ( $post->post_parent < 1 && isset($_REQUEST['post_id']) ) { 1226 1228 $parent = (int) $_REQUEST['post_id']; 1227 1229 $parent_name = "attachments[$attachment_id][post_parent]"; … … 1701 1703 <input type="hidden" name="tab" value="<?php echo attribute_escape( $tab ); ?>" /> 1702 1704 <input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" /> 1703 <input type="hidden" name="post_mime_type" value="<?php echo attribute_escape( $_GET['post_mime_type'] ); ?>" />1705 <input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? attribute_escape( $_GET['post_mime_type'] ) : ''; ?>" /> 1704 1706 1705 1707 <p id="media-search" class="search-box"> … … 1716 1718 foreach ( $matches as $_type => $reals ) 1717 1719 foreach ( $reals as $real ) 1718 $num_posts[$_type] += $_num_posts[$real]; 1720 if ( isset($num_posts[$_type]) ) 1721 $num_posts[$_type] += $_num_posts[$real]; 1722 else 1723 $num_posts[$_type] = $_num_posts[$real]; 1719 1724 // If available type specified by media button clicked, filter by that type 1720 1725 if ( empty($_GET['post_mime_type']) && !empty($num_posts[$type]) ) { … … 1724 1729 if ( empty($_GET['post_mime_type']) || $_GET['post_mime_type'] == 'all' ) 1725 1730 $class = ' class="current"'; 1731 else 1732 $class = ''; 1726 1733 $type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>'all', 'paged'=>false, 'm'=>false))) . "'$class>".__('All Types')."</a>"; 1727 1734 foreach ( $post_mime_types as $mime_type => $label ) { … … 1731 1738 continue; 1732 1739 1733 if ( wp_match_mime_types($mime_type, $_GET['post_mime_type']) )1740 if ( isset($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) ) 1734 1741 $class = ' class="current"'; 1735 1742
Note: See TracChangeset
for help on using the changeset viewer.