Changeset 1324
- Timestamp:
- 06/10/08 14:08:54 (4 months ago)
- Files:
-
- trunk/wp-admin/async-upload.php (modified) (2 diffs)
- trunk/wp-admin/comment.php (modified) (1 diff)
- trunk/wp-admin/css/media.css (modified) (2 diffs)
- trunk/wp-admin/css/widgets-rtl.css (modified) (1 diff)
- trunk/wp-admin/css/widgets.css (modified) (7 diffs)
- trunk/wp-admin/edit-comments.php (modified) (1 diff)
- trunk/wp-admin/includes/dashboard.php (modified) (1 diff)
- trunk/wp-admin/includes/media.php (modified) (8 diffs)
- trunk/wp-admin/includes/upgrade.php (modified) (2 diffs)
- trunk/wp-admin/includes/widgets.php (modified) (2 diffs)
- trunk/wp-admin/js/link.js (modified) (1 diff)
- trunk/wp-admin/js/media-upload.js (modified) (2 diffs)
- trunk/wp-admin/js/widgets.js (modified) (2 diffs)
- trunk/wp-admin/media.php (modified) (1 diff)
- trunk/wp-admin/menu.php (modified) (1 diff)
- trunk/wp-admin/plugins.php (modified) (1 diff)
- trunk/wp-admin/update.php (modified) (1 diff)
- trunk/wp-admin/user-edit.php (modified) (1 diff)
- trunk/wp-admin/widgets.php (modified) (1 diff)
- trunk/wp-content/themes/classic/index.php (modified) (1 diff)
- trunk/wp-includes/comment.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (2 diffs)
- trunk/wp-includes/general-template.php (modified) (1 diff)
- trunk/wp-includes/js/swfupload/handlers.js (modified) (1 diff)
- trunk/wp-includes/js/thickbox/thickbox.css (modified) (3 diffs)
- trunk/wp-includes/link-template.php (modified) (2 diffs)
- trunk/wp-includes/media.php (modified) (2 diffs)
- trunk/wp-includes/post.php (modified) (8 diffs)
- trunk/wp-includes/rewrite.php (modified) (1 diff)
- trunk/wp-includes/script-loader.php (modified) (4 diffs)
- trunk/wp-includes/taxonomy.php (modified) (4 diffs)
- trunk/wp-includes/version.php (modified) (2 diffs)
- trunk/wp-includes/widgets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/async-upload.php
r1260 r1324 16 16 require_once('admin.php'); 17 17 18 header('Content-Type: text/plain ');18 header('Content-Type: text/plain; charset=' . get_option('blog_charset')); 19 19 20 20 if ( !current_user_can('upload_files') ) … … 26 26 exit; 27 27 } 28 29 check_admin_referer('media-form'); 28 30 29 31 $id = media_handle_upload('async-upload', $_REQUEST['post_id']); trunk/wp-admin/comment.php
r1260 r1324 194 194 wp_set_comment_status( $comment->comment_ID, 'approve' ); 195 195 196 if ( true == get_option('comments_notify') )197 wp_notify_postauthor( $comment->comment_ID );198 199 200 196 if ( '' != wp_get_referer() && false == $noredir ) 201 197 wp_redirect( wp_get_referer() ); trunk/wp-admin/css/media.css
r1260 r1324 197 197 margin: 0 1em 1em 0; 198 198 } 199 200 #media-upload .media-upload-form p.ml-submit { 201 padding: 1em 0; 202 } 203 199 204 #media-upload p.help { 200 205 font-style: italic; … … 241 246 height: 3em; 242 247 } 248 249 #media-upload #filter { 250 width: 623px; 251 } 252 253 #media-upload #filter .subsubsub { 254 margin: 8px 0; 255 } 256 257 #filter .tablenav select { 258 border-style:solid; 259 border-width:1px; 260 padding:2px; 261 vertical-align:top; 262 } trunk/wp-admin/css/widgets-rtl.css
r1260 r1324 39 39 } 40 40 41 li.widget-list-control-item div.widget-control {42 padding:0 0 0 10px;43 }44 41 ul.widget-control-list div.widget-control-actions { 45 42 margin-right:0; 46 43 margin-left:-10px; 47 44 } 48 ul.widget-control-list .widget-title { 49 text-align:right; 45 ul.widget-control-list h4.widget-title, 46 #dragHelper h4.widget-title { 47 text-align: right; 48 padding: 0.4em 0.8em 0.4em 2.5em; 50 49 } trunk/wp-admin/css/widgets.css
r1260 r1324 75 75 } 76 76 77 78 77 ul#widget-list li.widget-list-item ul.widget-control-info { 79 78 display: none; … … 92 91 } 93 92 94 ul.widget-control-list li {95 position: relative;96 }97 98 93 div#current-widgets p.submit { 99 94 padding: 1em; … … 101 96 102 97 li.widget-list-control-item { 103 margin: 0 0 1em;98 margin: 1em 0; 104 99 -moz-border-radius: 3px; 105 100 -khtml-border-radius: 3px; … … 108 103 } 109 104 110 li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.widget-sortable h4 { 105 li.widget-list-control-item h4, 106 #dragHelper li.widget-list-control-item h4, 107 li.widget-sortable h4 { 111 108 margin: 0; 112 padding: 0.4em 2.5em 0.4em 0.8em;113 109 cursor: move; 114 110 font-size: 13px; 111 padding: 0.4em 2.5em 0.4em 0.8em; 112 position: relative; 115 113 -moz-border-radius: 3px; 116 114 -khtml-border-radius: 3px; … … 144 142 145 143 li.widget-list-control-item h4.widget-title a:hover { 146 147 144 text-decoration: none; 148 145 border-bottom: none; … … 151 148 li.widget-list-control-item div.widget-control { 152 149 display: none; 153 margin: 1em; 154 padding: 0 10px 0 7px; /* Correction for padding, margin, border of inputs */ 150 padding: 15px; 155 151 font-size: 11px; 152 position: relative; 153 background-color: #CFEBF7; 156 154 } 157 155 … … 162 160 163 161 ul.widget-control-list div.widget-control-actions { 164 margin-right: -10px; /* Correction for padding, margin, border of inputs */165 margin-left: -6px;166 162 border-top-width: 1px; 167 163 border-top-style: solid; 168 padding: 0.5em 0 0.8em; 169 } 170 171 ul.widget-control-list .widget-title { 172 164 padding: 0.5em 0 0; 173 165 } 174 166 trunk/wp-admin/edit-comments.php
r1218 r1324 98 98 $status_links = array(); 99 99 $num_comments = wp_count_comments(); 100 $stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', $num_comments->moderated), "<span class='comment-count'>$num_comments->moderated</span>"), 'approved' => _c('Approved|plural'));100 $stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 'approved' => _c('Approved|plural')); 101 101 $class = ( '' === $comment_status ) ? ' class="current"' : ''; 102 102 $status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>"; trunk/wp-admin/includes/dashboard.php
r1301 r1324 24 24 25 25 // Recent Comments Widget 26 if ( current_user_can( 'moderate_comments' ) && $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) { 26 $mod_comments = wp_count_comments(); 27 $mod_comments = $mod_comments->moderated; 28 if ( current_user_can( 'moderate_comments' ) && $mod_comments ) { 27 29 $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); 28 30 $notice = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>"; trunk/wp-admin/includes/media.php
r1301 r1324 56 56 57 57 if ( $url ) 58 $html = "<a href='".attribute_escape($url)."'$rel>$html</a>";58 $html = '<a href="' . clean_url($url) . "\"$rel>$html</a>"; 59 59 60 60 $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); … … 181 181 $siteurl = get_option('siteurl'); 182 182 echo "<style type='text/css' media='all'> 183 @import '{$siteurl}/wp-includes/js/thickbox/thickbox.css? 1';183 @import '{$siteurl}/wp-includes/js/thickbox/thickbox.css?ver=20080430'; 184 184 div#TB_title { 185 185 background-color: #222222; … … 188 188 div#TB_title a, div#TB_title a:visited { 189 189 color: #cfcfcf; 190 } 191 #TB_window { 192 top: 20px; 190 193 } 191 194 </style>\n"; … … 792 795 "post_id" : "<?php echo $post_id; ?>", 793 796 "auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>", 797 "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>", 794 798 "type" : "<?php echo $type; ?>", 795 799 "tab" : "<?php echo $tab; ?>", … … 816 820 </script> 817 821 822 818 823 <div id="flash-upload-ui"> 819 824 <?php do_action('pre-flash-upload-ui'); ?> … … 960 965 </div> 961 966 962 <p>963 967 <ul class="subsubsub"> 964 968 <?php … … 992 996 ?> 993 997 </ul> 994 </p>995 998 996 999 <div class="tablenav"> … … 1067 1070 <?php echo get_media_items(null, $errors); ?> 1068 1071 </div> 1072 <p class="ml-submit"> 1069 1073 <input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" /> 1070 1074 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> 1075 </p> 1071 1076 </form> 1072 1077 <?php trunk/wp-admin/includes/upgrade.php
r1260 r1324 205 205 if ( $wp_current_db_version < 7796 ) 206 206 upgrade_251(); 207 208 if ( $wp_current_db_version < 7935 ) 209 upgrade_252(); 207 210 208 211 maybe_disable_automattic_widgets(); … … 746 749 // Make the secret longer 747 750 update_option('secret', wp_generate_password(64)); 751 } 752 753 function upgrade_252() { 754 global $wpdb; 755 756 $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''"); 748 757 } 749 758 trunk/wp-admin/includes/widgets.php
r1301 r1324 228 228 echo $sidebar_args['before_widget']; 229 229 ?> 230 <div class="widget-top"> 230 231 <h4 class="widget-title"><?php echo $widget_title ?> 231 232 … … 240 241 <?php endif; ?> 241 242 242 </h4> 243 </h4></div> 243 244 244 245 <div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>> trunk/wp-admin/js/link.js
r1218 r1324 1 1 jQuery(document).ready( function() { 2 // close postboxes that should be closed 3 jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); 4 2 5 jQuery('#link_name').focus(); 3 6 // postboxes trunk/wp-admin/js/media-upload.js
r1214 r1324 1 1 // send html to the post editor 2 2 function send_to_editor(h) { 3 var win = window.opener ? window.opener : window.dialogArguments; 4 if ( !win ) 5 win = top; 3 var win = window.dialogArguments || opener || parent || top; 4 6 5 tinyMCE = win.tinyMCE; 7 6 if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) { … … 11 10 win.edInsertContent(win.edCanvas, h); 12 11 } 12 13 // thickbox settings 14 jQuery(function($) { 15 tb_position = function() { 16 var tbWindow = $('#TB_window'); 17 var width = $(window).width(); 18 var H = $(window).height(); 19 var W = ( 720 < width ) ? 720 : width; 20 21 if ( tbWindow.size() ) { 22 tbWindow.width( W - 50 ).height( H - 45 ); 23 $('#TB_iframeContent').width( W - 50 ).height( H - 75 ); 24 tbWindow.css({marginLeft: '-' + parseInt((( W - 50 ) / 2),10) + 'px'}); 25 }; 26 27 return $('a.thickbox').each( function() { 28 var href = $(this).attr('href'); 29 if ( ! href ) return; 30 href = href.replace(/&width=[0-9]+/g, ''); 31 href = href.replace(/&height=[0-9]+/g, ''); 32 $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) ); 33 }); 34 }; 35 36 $(window).resize( function() { tb_position() } ); 37 $(document).ready( function() { tb_position() } ); 38 }); 39 trunk/wp-admin/js/widgets.js
r1260 r1324 14 14 if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } 15 15 li.css( 'marginLeft', 0 ); 16 t.siblings(' h4').children('a').text( widgetsL10n.edit );16 t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); 17 17 } else { 18 18 t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open 19 19 if ( width > 250 ) 20 20 li.css( 'marginLeft', ( width - 250 ) * -1 ); 21 t.siblings(' h4').children('a').text( widgetsL10n.cancel );21 t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); 22 22 } 23 23 t.toggle(); … … 29 29 if ( width > 250 ) 30 30 li.animate( { marginLeft: 0 } ); 31 t.siblings(' h4').children('a').text( widgetsL10n.edit );31 t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); 32 32 } else { 33 33 t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open 34 34 if ( width > 250 ) 35 35 li.animate( { marginLeft: ( width - 250 ) * -1 } ); 36 t.siblings(' h4').children('a').text( widgetsL10n.cancel );36 t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); 37 37 } 38 38 t.animate( { height: 'toggle' } ); trunk/wp-admin/media.php
r1275 r1324 93 93 <?php wp_nonce_field('media-form'); ?> 94 94 </p> 95 95 </form> 96 96 97 97 </div> trunk/wp-admin/menu.php
r1260 r1324 24 24 $awaiting_mod = $awaiting_mod->moderated; 25 25 $menu[15] = array(__('Design'), 'switch_themes', 'themes.php'); 26 $menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='comment-count'> $awaiting_mod</span></span>" ), 'edit_posts', 'edit-comments.php');26 $menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='comment-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php'); 27 27 $menu[30] = array(__('Settings'), 'manage_options', 'options-general.php'); 28 28 $menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); trunk/wp-admin/plugins.php
r1218 r1324 94 94 if ( !empty($active) ) { 95 95 ?> 96 <a class="button-secondary " href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>" class="delete"><?php _e('Deactivate All Plugins'); ?></a>96 <a class="button-secondary delete" href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>"><?php _e('Deactivate All Plugins'); ?></a> 97 97 <?php 98 98 } elseif ( empty($active) && !empty($inactive) ) { 99 99 ?> 100 <a class="button-secondary " href="<?php echo wp_nonce_url('plugins.php?action=reactivate-all', 'reactivate-all'); ?>" class="delete"><?php _e('Reactivate Plugins'); ?></a>100 <a class="button-secondary delete" href="<?php echo wp_nonce_url('plugins.php?action=reactivate-all', 'reactivate-all'); ?>"><?php _e('Reactivate Plugins'); ?></a> 101 101 <?php 102 102 } // endif active/inactive plugin check trunk/wp-admin/update.php
r1218 r1324 23 23 $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); 24 24 $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : $credentials['password']); 25 $credentials['ssl'] = defined('FTP_SSL') ? FTP_SSL : ( !empty($_POST['ssl']) ? $_POST['ssl'] : $credentials['ssl']);25 $credentials['ssl'] = defined('FTP_SSL') ? FTP_SSL : ( isset($_POST['ssl']) ? $_POST['ssl'] : $credentials['ssl']); 26 26 27 27 if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { trunk/wp-admin/user-edit.php
r1227 r1324 172 172 <td> 173 173 <?php 174 $current_color = get_user_option('admin_color' );174 $current_color = get_user_option('admin_color', $user_id); 175 175 if ( empty($current_color) ) 176 176 $current_color = 'fresh'; trunk/wp-admin/widgets.php
r1260 r1324 135 135 <ul class="widget-control-list"> 136 136 <li class="widget-list-control-item"> 137 <div class="widget-top"> 137 138 <h4 class="widget-title"><?php echo $control['name']; ?></h4> 139 </div> 138 140 <div class="widget-control" style="display: block;"> 139 141 <?php trunk/wp-content/themes/classic/index.php
r1069 r1324 28 28 <?php endif; ?> 29 29 30 <?php posts_nav_link(' — ', __('« Older Posts'), __('Newer Posts »')); ?>30 <?php posts_nav_link(' — ', __('« Newer Posts'), __('Older Posts »')); ?> 31 31 32 32 <?php get_footer(); ?> trunk/wp-includes/comment.php
r1260 r1324 727 727 case 'approve': 728 728 $query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1"; 729 if ( get_option('comments_notify') ) { 730 $comment = get_comment($comment_id); 731 wp_notify_postauthor($comment_id, $comment->comment_type); 732 } 733 729 734 break; 730 735 case 'spam': trunk/wp-includes/functions.php
r1320 r1324 1432 1432 } 1433 1433 1434 1434 1435 function _mce_set_direction( $input ) { 1435 1436 global $wp_locale; … … 1443 1444 return $input; 1444 1445 } 1446 1445 1447 1446 1448 function smilies_init() { trunk/wp-includes/general-template.php
r1218 r1324 344 344 345 345 if ('link' == $format) 346 return"\t<link rel='archives' title='$title_text' href='$url' />\n";346 $link_html = "\t<link rel='archives' title='$title_text' href='$url' />\n"; 347 347 elseif ('option' == $format) 348 return"\t<option value='$url'>$before $text $after</option>\n";348 $link_html = "\t<option value='$url'>$before $text $after</option>\n"; 349 349 elseif ('html' == $format) 350 return"\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n";350 $link_html = "\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n"; 351 351 else // custom 352 return "\t$before<a href='$url' title='$title_text'>$text</a>$after\n"; 352 $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n"; 353 354 $link_html = apply_filters( "get_archives_link", $link_html ); 355 356 return $link_html; 353 357 } 354 358 trunk/wp-includes/js/swfupload/handlers.js
r1260 r1324 56 56 57 57 // Also bind toggle to the links 58 jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150 );jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;});58 jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){window.scrollTo(0,this.parentNode.offsetTop);});jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;}); 59 59 60 60 // Bind AJAX to the new Delete button trunk/wp-includes/js/thickbox/thickbox.css
r1214 r1324 46 46 #TB_window { 47 47 position: fixed; 48 background: #ffffff;49 48 z-index: 102; 50 49 color:#000000; 51 50 display:none; 52 border: 4px solid #525252;53 51 text-align:left; 54 top: 50%;52 top:20px; 55 53 left:50%; 56 54 } … … 58 56 * html #TB_window { /* ie6 hack */ 59 57 position: absolute; 60 margin-top: expression( 0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');58 margin-top: expression(20) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); 61 59 } 62 60 … … 98 96 background-color:#e8e8e8; 99 97 height:27px; 98 border-width: 4px; 99 border-color: #525252; 100 border-style: solid solid none; 100 101 } 101 102 trunk/wp-includes/link-template.php
r1260 r1324 185 185 $name = $object->post_name; 186 186 if (strpos($parentlink, '?') === false) 187 $link = trailingslashit($parentlink) . $name . '/';187 $link = user_trailingslashit( trailingslashit($parentlink) . $name ); 188 188 } 189 189 … … 403 403 else 404 404 $feed_link = "feed/$feed"; 405 $link = $link. user_trailingslashit($feed_link, 'feed');405 $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed'); 406 406 } 407 407 trunk/wp-includes/media.php
r1266 r1324 91 91 } 92 92 93 // return an <img src /> tag for the given image attachment, scaling it down if requested 93 /** 94 * An <img src /> tag for an image attachment, scaling it down if requested. 95 * 96 * {@internal Missing Long Description}} 97 * 98 * @uses apply_filters() The 'get_image_tag_class' filter is the IMG element 99 * class attribute. 100 * @uses apply_filters() The 'get_image_tag' filter is the full IMG element with 101 * all attributes. 102 * 103 * @param int $id Attachment ID. 104 * @param string $alt Image Description for the alt attribute. 105 * @param string $title Image Description for the title attribute. 106 * @param string $align Part of the class name for aligning the image. 107 * @param string $size Optional. Default is 'medium'. 108 * @return string HTML IMG element for given image attachment 109 */ 94 110 function get_image_tag($id, $alt, $title, $align, $size='medium') { 95 111 … … 97 113 $hwstring = image_hwstring($width, $height); 98 114 99 $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id.'" />'; 100 101 $url = ''; 102 $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); 115 $class = 'align'.attribute_escape($align).' size-'.attribute_escape($size).' wp-image-'.$id; 116 $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); 117 118 $html = '<img src="'.attribute_escape($img_src).'" alt="'.attribute_escape($alt).'" title="'.attribute_escape($title).'" '.$hwstring.'class="'.$class.'" />'; 119 120 $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 103 121 104 122 return $html; trunk/wp-includes/post.php
r1305 r1324 200 200 * @since 2.5 201 201 * 202 * @param string $field {@internal Missing Description}} 203 * @param int|object &$post post ID or post object 202 * @param int|object $post post ID or post object 204 203 * @return array of ancestor IDs 205 204 */ 206 205 function get_post_ancestors($post) { 207 $post = get_post( );206 $post = get_post($post); 208 207 209 208 if ( !empty($post->ancestors) ) … … 1165 1164 * @return int post ID or 0 on error 1166 1165 */ 1167 function wp_insert_post($postarr = array() ) {1166 function wp_insert_post($postarr = array(), $wp_error = false) { 1168 1167 global $wpdb, $wp_rewrite, $user_ID; 1169 1168 … … 1188 1187 } 1189 1188 1190 if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) ) 1191 return 0; 1189 if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) ) { 1190 if ( $wp_error ) 1191 return new WP_Error('empty_content', __('Content, title, and excerpt are empty.')); 1192 else 1193 return 0; 1194 } 1192 1195 1193 1196 // Make sure we set a valid category … … 1286 1289 do { 1287 1290 $alt_post_name = substr($post_name, 0, 200-(strlen($suffix)+1)). "-$suffix"; 1288 // expected_slashed ($alt_post_name, $post_name, $post_type) 1289 $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != %d AND post_parent = %d LIMIT 1", $post_ID, $post_parent)); 1291 $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1", $alt_post_name, $post_type, $post_ID, $post_parent)); 1290 1292 $suffix++; 1291 1293 } while ($post_name_check); … … 1301 1303 if ($update) { 1302 1304 do_action( 'pre_post_update', $post_ID ); 1303 $wpdb->update( $wpdb->posts, $data, $where ); 1305 if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { 1306 if ( $wp_error ) 1307 return new WP_Error('db_update_error', __('Could not update post in the database'), $wpdb->last_error); 1308 else 1309 return 0; 1310 } 1304 1311 } else { 1305 1312 $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update 1306 $wpdb->insert( $wpdb->posts, $data ); 1313 if ( false === $wpdb->insert( $wpdb->posts, $data ) ) { 1314 if ( $wp_error ) 1315 return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error); 1316 else 1317 return 0; 1318 } 1307 1319 $post_ID = (int) $wpdb->insert_id; 1308 1320 … … 1321 1333 $current_guid = get_post_field( 'guid', $post_ID ); 1322 1334 1323 if ( 'page' == $post_type ) {1335 if ( 'page' == $post_type ) 1324 1336 clean_page_cache($post_ID); 1325 } else {1337 else 1326 1338 clean_post_cache($post_ID); 1327 }1328 1339 1329 1340 // Set GUID … … 1332 1343 1333 1344 $post = get_post($post_ID); 1334 if ( !empty($page_template) ) 1345 1346 if ( !empty($page_template) && 'page' == $post_type ) { 1335 1347 $post->page_template = $page_template; 1348 $page_templates = get_page_templates(); 1349 if ( 'default' != $page_template && !in_array($page_template, $page_templates) ) { 1350 if ( $wp_error ) 1351 return new WP_Error('invalid_page_template', __('The page template is invalid.')); 1352 else 1353 return 0; 1354 } 1355 if ( ! update_post_meta($post_ID, '_wp_page_template', $page_template) ) 1356 add_post_meta($post_ID, '_wp_page_template', $page_template, true); 1357 } 1336 1358 1337 1359 wp_transition_post_status($post_status, $previous_status, $post); … … 2944 2966 function _save_post_hook($post_id, $post) { 2945 2967 if ( $post->post_type == 'page' ) { 2946 if ( !empty($post->page_template) )2947 if ( ! update_post_meta($post_id, '_wp_page_template', $post->page_template))2948 add_post_meta($post_id, '_wp_page_template', $post->page_template, true);2949 2950 2968 clean_page_cache($post_id); 2951 2969 global $wp_rewrite; trunk/wp-includes/rewrite.php
r1260 r1324 794 794 795 795 //Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category% 796 $default_feeds = array( '.* /wp-atom.php$' => $this->index .'?feed=atom',797 '.* /wp-rdf.php$' => $this->index .'?feed=rdf',798 '.* /wp-rss.php$' => $this->index .'?feed=rss',799 '.* /wp-rss2.php$' => $this->index .'?feed=rss2',800 '.* /wp-feed.php$' => $this->index .'?feed=feed',801 '.* /wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');796 $default_feeds = array( '.*wp-atom.php$' => $this->index .'?feed=atom', 797 '.*wp-rdf.php$' => $this->index .'?feed=rdf', 798 '.*wp-rss.php$' => $this->index .'?feed=rss', 799 '.*wp-rss2.php$' => $this->index .'?feed=rss2', 800 '.*wp-feed.php$' => $this->index .'?feed=feed', 801 '.*wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1'); 802 802 803 803 // Post trunk/wp-includes/script-loader.php
r1299 r1324 81 81 $this->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('dimensions'), '1.1'); 82 82 $this->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20'); 83 $this->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1 ');84 $this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2 ');83 $this->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430'); 84 $this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2-20080430'); 85 85 $this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); 86 86 $this->localize( 'swfupload-degrade', 'uploadDegradeOptions', array( … … 145 145 'cancel' => __('Cancel'), 146 146 ) ); 147 $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080 519' );147 $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080422' ); 148 148 $this->localize( 'post', 'postL10n', array( 149 149 'tagsUsed' => __('Tags used on this post:'), … … 165 165 'edit' => __('Edit'), 166 166 ) ); 167 $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080 109' );167 $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080430' ); 168 168 $this->localize( 'upload', 'uploadL10n', array( 169 169 'browseTitle' => attribute_escape(__('Browse your files')), … … 188 188 'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.") 189 189 ) ); 190  
