Changeset 1324

Show
Ignore:
Timestamp:
06/10/08 14:08:54 (4 months ago)
Author:
donncha
Message:

Merge with branches/2.5 in WordPress?, revision 8066

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/async-upload.php

    r1260 r1324  
    1616require_once('admin.php'); 
    1717 
    18 header('Content-Type: text/plain'); 
     18header('Content-Type: text/plain; charset=' . get_option('blog_charset')); 
    1919 
    2020if ( !current_user_can('upload_files') ) 
     
    2626        exit; 
    2727} 
     28 
     29check_admin_referer('media-form'); 
    2830 
    2931$id = media_handle_upload('async-upload', $_REQUEST['post_id']); 
  • trunk/wp-admin/comment.php

    r1260 r1324  
    194194        wp_set_comment_status( $comment->comment_ID, 'approve' ); 
    195195 
    196         if ( true == get_option('comments_notify') ) 
    197                 wp_notify_postauthor( $comment->comment_ID ); 
    198  
    199  
    200196        if ( '' != wp_get_referer() && false == $noredir ) 
    201197                wp_redirect( wp_get_referer() ); 
  • trunk/wp-admin/css/media.css

    r1260 r1324  
    197197        margin: 0 1em 1em 0; 
    198198} 
     199 
     200#media-upload .media-upload-form p.ml-submit { 
     201        padding: 1em 0; 
     202} 
     203 
    199204#media-upload p.help { 
    200205        font-style: italic; 
     
    241246        height: 3em; 
    242247} 
     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  
    3939} 
    4040 
    41 li.widget-list-control-item div.widget-control { 
    42         padding:0 0 0 10px; 
    43 } 
    4441ul.widget-control-list div.widget-control-actions { 
    4542        margin-right:0; 
    4643        margin-left:-10px; 
    4744} 
    48 ul.widget-control-list .widget-title { 
    49         text-align:right; 
     45ul.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; 
    5049} 
  • trunk/wp-admin/css/widgets.css

    r1260 r1324  
    7575} 
    7676 
    77  
    7877ul#widget-list li.widget-list-item ul.widget-control-info { 
    7978        display: none; 
     
    9291} 
    9392 
    94 ul.widget-control-list li { 
    95         position: relative; 
    96 } 
    97  
    9893div#current-widgets p.submit { 
    9994        padding: 1em; 
     
    10196 
    10297li.widget-list-control-item { 
    103         margin: 0 0 1em
     98        margin: 1em 0
    10499        -moz-border-radius: 3px; 
    105100        -khtml-border-radius: 3px; 
     
    108103} 
    109104 
    110 li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.widget-sortable h4 { 
     105li.widget-list-control-item h4,  
     106#dragHelper li.widget-list-control-item h4,  
     107li.widget-sortable h4 { 
    111108        margin: 0; 
    112         padding: 0.4em 2.5em 0.4em 0.8em; 
    113109        cursor: move; 
    114110        font-size: 13px; 
     111        padding: 0.4em 2.5em 0.4em 0.8em; 
     112        position: relative; 
    115113        -moz-border-radius: 3px; 
    116114        -khtml-border-radius: 3px; 
     
    144142 
    145143li.widget-list-control-item h4.widget-title a:hover { 
    146  
    147144        text-decoration: none; 
    148145        border-bottom: none; 
     
    151148li.widget-list-control-item div.widget-control { 
    152149        display: none; 
    153         margin: 1em; 
    154         padding: 0 10px 0 7px; /* Correction for padding, margin, border of inputs */ 
     150        padding: 15px; 
    155151        font-size: 11px; 
     152        position: relative; 
     153        background-color: #CFEBF7; 
    156154} 
    157155 
     
    162160 
    163161ul.widget-control-list div.widget-control-actions { 
    164         margin-right: -10px; /* Correction for padding, margin, border of inputs */ 
    165         margin-left: -6px; 
    166162        border-top-width: 1px; 
    167163        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; 
    173165} 
    174166 
  • trunk/wp-admin/edit-comments.php

    r1218 r1324  
    9898$status_links = array(); 
    9999$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')); 
    101101$class = ( '' === $comment_status ) ? ' class="current"' : ''; 
    102102$status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>"; 
  • trunk/wp-admin/includes/dashboard.php

    r1301 r1324  
    2424 
    2525        // 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 ) { 
    2729                $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); 
    2830                $notice = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>"; 
  • trunk/wp-admin/includes/media.php

    r1301 r1324  
    5656 
    5757        if ( $url ) 
    58                 $html = "<a href='".attribute_escape($url)."'$rel>$html</a>"; 
     58                $html = '<a href="' . clean_url($url) . "\"$rel>$html</a>"; 
    5959 
    6060        $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); 
     
    181181$siteurl = get_option('siteurl'); 
    182182echo "<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'; 
    184184        div#TB_title { 
    185185                background-color: #222222; 
     
    188188        div#TB_title a, div#TB_title a:visited { 
    189189                color: #cfcfcf; 
     190        } 
     191        #TB_window { 
     192                top: 20px; 
    190193        } 
    191194</style>\n"; 
     
    792795                                "post_id" : "<?php echo $post_id; ?>", 
    793796                                "auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>", 
     797                                "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>", 
    794798                                "type" : "<?php echo $type; ?>", 
    795799                                "tab" : "<?php echo $tab; ?>", 
     
    816820</script> 
    817821 
     822 
    818823<div id="flash-upload-ui"> 
    819824<?php do_action('pre-flash-upload-ui'); ?> 
     
    960965</div> 
    961966 
    962 <p> 
    963967<ul class="subsubsub"> 
    964968<?php 
     
    992996?> 
    993997</ul> 
    994 </p> 
    995998 
    996999<div class="tablenav"> 
     
    10671070<?php echo get_media_items(null, $errors); ?> 
    10681071</div> 
     1072<p class="ml-submit"> 
    10691073<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" /> 
    10701074<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> 
     1075</p> 
    10711076</form> 
    10721077<?php 
  • trunk/wp-admin/includes/upgrade.php

    r1260 r1324  
    205205        if ( $wp_current_db_version < 7796 ) 
    206206                upgrade_251(); 
     207 
     208        if ( $wp_current_db_version < 7935 ) 
     209                upgrade_252(); 
    207210 
    208211        maybe_disable_automattic_widgets(); 
     
    746749        // Make the secret longer 
    747750        update_option('secret', wp_generate_password(64)); 
     751} 
     752 
     753function upgrade_252() { 
     754        global $wpdb; 
     755 
     756        $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''"); 
    748757} 
    749758 
  • trunk/wp-admin/includes/widgets.php

    r1301 r1324  
    228228                echo $sidebar_args['before_widget']; 
    229229?> 
     230                <div class="widget-top"> 
    230231                <h4 class="widget-title"><?php echo $widget_title ?> 
    231232 
     
    240241                        <?php endif; ?> 
    241242 
    242                 </h4> 
     243                </h4></div> 
    243244 
    244245                <div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>> 
  • trunk/wp-admin/js/link.js

    r1218 r1324  
    11jQuery(document).ready( function() { 
     2        // close postboxes that should be closed 
     3        jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); 
     4 
    25        jQuery('#link_name').focus(); 
    36        // postboxes 
  • trunk/wp-admin/js/media-upload.js

    r1214 r1324  
    11// send html to the post editor 
    22function 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 
    65        tinyMCE = win.tinyMCE; 
    76        if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) { 
     
    1110                win.edInsertContent(win.edCanvas, h); 
    1211} 
     12 
     13// thickbox settings 
     14jQuery(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  
    1414                                if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } 
    1515                                li.css( 'marginLeft', 0 ); 
    16                                 t.siblings('h4').children('a').text( widgetsL10n.edit ); 
     16                                t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); 
    1717                        } else { 
    1818                                t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open 
    1919                                if ( width > 250 ) 
    2020                                        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 ); 
    2222                        } 
    2323                        t.toggle(); 
     
    2929                                if ( width > 250 ) 
    3030                                        li.animate( { marginLeft: 0 } ); 
    31                                 t.siblings('h4').children('a').text( widgetsL10n.edit ); 
     31                                t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); 
    3232                        } else { 
    3333                                t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open 
    3434                                if ( width > 250 ) 
    3535                                        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 ); 
    3737                        } 
    3838                        t.animate( { height: 'toggle' } ); 
  • trunk/wp-admin/media.php

    r1275 r1324  
    9393<?php wp_nonce_field('media-form'); ?> 
    9494</p> 
    95  
     95</form> 
    9696 
    9797</div> 
  • trunk/wp-admin/menu.php

    r1260 r1324  
    2424$awaiting_mod = $awaiting_mod->moderated; 
    2525$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'); 
    2727$menu[30] = array(__('Settings'), 'manage_options', 'options-general.php'); 
    2828$menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); 
  • trunk/wp-admin/plugins.php

    r1218 r1324  
    9494        if ( !empty($active) ) { 
    9595        ?> 
    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> 
    9797        <?php 
    9898        } elseif ( empty($active) && !empty($inactive) ) { 
    9999        ?> 
    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> 
    101101        <?php 
    102102        } // endif active/inactive plugin check 
  • trunk/wp-admin/update.php

    r1218 r1324  
    2323        $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); 
    2424        $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']); 
    2626 
    2727        if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { 
  • trunk/wp-admin/user-edit.php

    r1227 r1324  
    172172<td> 
    173173<?php 
    174 $current_color = get_user_option('admin_color'); 
     174$current_color = get_user_option('admin_color', $user_id); 
    175175if ( empty($current_color) ) 
    176176        $current_color = 'fresh'; 
  • trunk/wp-admin/widgets.php

    r1260 r1324  
    135135                        <ul class="widget-control-list"> 
    136136                                <li class="widget-list-control-item"> 
     137                                        <div class="widget-top"> 
    137138                                        <h4 class="widget-title"><?php echo $control['name']; ?></h4> 
     139                                        </div> 
    138140                                        <div class="widget-control" style="display: block;"> 
    139141        <?php 
  • trunk/wp-content/themes/classic/index.php

    r1069 r1324  
    2828<?php endif; ?> 
    2929 
    30 <?php posts_nav_link(' &#8212; ', __('&laquo; Older Posts'), __('Newer Posts &raquo;')); ?> 
     30<?php posts_nav_link(' &#8212; ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); ?> 
    3131 
    3232<?php get_footer(); ?> 
  • trunk/wp-includes/comment.php

    r1260 r1324  
    727727                case 'approve': 
    728728                        $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 
    729734                        break; 
    730735                case 'spam': 
  • trunk/wp-includes/functions.php

    r1320 r1324  
    14321432} 
    14331433 
     1434 
    14341435function _mce_set_direction( $input ) { 
    14351436        global $wp_locale; 
     
    14431444        return $input; 
    14441445} 
     1446 
    14451447 
    14461448function smilies_init() { 
  • trunk/wp-includes/general-template.php

    r1218 r1324  
    344344 
    345345        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"; 
    347347        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"; 
    349349        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"; 
    351351        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; 
    353357} 
    354358 
  • trunk/wp-includes/js/swfupload/handlers.js

    r1260 r1324  
    5656 
    5757        // 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;}); 
    5959 
    6060        // Bind AJAX to the new Delete button 
  • trunk/wp-includes/js/thickbox/thickbox.css

    r1214 r1324  
    4646#TB_window { 
    4747        position: fixed; 
    48         background: #ffffff; 
    4948        z-index: 102; 
    5049        color:#000000; 
    5150        display:none; 
    52         border: 4px solid #525252; 
    5351        text-align:left; 
    54         top:50%
     52        top:20px
    5553        left:50%; 
    5654} 
     
    5856* html #TB_window { /* ie6 hack */ 
    5957position: absolute; 
    60 margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); 
     58margin-top: expression(20) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); 
    6159} 
    6260 
     
    9896        background-color:#e8e8e8; 
    9997        height:27px; 
     98        border-width: 4px; 
     99        border-color: #525252; 
     100        border-style: solid solid none; 
    100101} 
    101102 
  • trunk/wp-includes/link-template.php

    r1260 r1324  
    185185                        $name = $object->post_name; 
    186186                if (strpos($parentlink, '?') === false) 
    187                         $link = trailingslashit($parentlink) . $name . '/'
     187                        $link = user_trailingslashit( trailingslashit($parentlink) . $name )
    188188        } 
    189189 
     
    403403                else 
    404404                        $feed_link = "feed/$feed"; 
    405                 $link = $link . user_trailingslashit($feed_link, 'feed'); 
     405                $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed'); 
    406406        } 
    407407 
  • trunk/wp-includes/media.php

    r1266 r1324  
    9191} 
    9292 
    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 */ 
    94110function get_image_tag($id, $alt, $title, $align, $size='medium') { 
    95111 
     
    97113        $hwstring = image_hwstring($width, $height); 
    98114 
    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 ); 
    103121 
    104122        return $html; 
  • trunk/wp-includes/post.php

    r1305 r1324  
    200200 * @since 2.5 
    201201 * 
    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 
    204203 * @return array of ancestor IDs 
    205204 */ 
    206205function get_post_ancestors($post) { 
    207         $post = get_post(); 
     206        $post = get_post($post); 
    208207 
    209208        if ( !empty($post->ancestors) ) 
     
    11651164 * @return int post ID or 0 on error 
    11661165 */ 
    1167 function wp_insert_post($postarr = array()) { 
     1166function wp_insert_post($postarr = array(), $wp_error = false) { 
    11681167        global $wpdb, $wp_rewrite, $user_ID; 
    11691168 
     
    11881187        } 
    11891188 
    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        } 
    11921195 
    11931196        // Make sure we set a valid category 
     
    12861289                        do { 
    12871290                                $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)); 
    12901292                                $suffix++; 
    12911293                        } while ($post_name_check); 
     
    13011303        if ($update) { 
    13021304                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                } 
    13041311        } else { 
    13051312                $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                } 
    13071319                $post_ID = (int) $wpdb->insert_id; 
    13081320 
     
    13211333        $current_guid = get_post_field( 'guid', $post_ID ); 
    13221334 
    1323         if ( 'page' == $post_type ) { 
     1335        if ( 'page' == $post_type ) 
    13241336                clean_page_cache($post_ID); 
    1325         } else { 
     1337        else 
    13261338                clean_post_cache($post_ID); 
    1327         } 
    13281339 
    13291340        // Set GUID 
     
    13321343 
    13331344        $post = get_post($post_ID); 
    1334         if ( !empty($page_template) ) 
     1345 
     1346        if ( !empty($page_template) && 'page' == $post_type ) { 
    13351347                $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        } 
    13361358 
    13371359        wp_transition_post_status($post_status, $previous_status, $post); 
     
    29442966function _save_post_hook($post_id, $post) { 
    29452967        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  
    29502968                clean_page_cache($post_id); 
    29512969                global $wp_rewrite; 
  • trunk/wp-includes/rewrite.php

    r1260 r1324  
    794794 
    795795                //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'); 
    802802 
    803803                // Post 
  • trunk/wp-includes/script-loader.php

    r1299 r1324  
    8181                $this->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('dimensions'), '1.1'); 
    8282                $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'); 
    8585                $this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); 
    8686                $this->localize( 'swfupload-degrade', 'uploadDegradeOptions', array( 
     
    145145                                'cancel' => __('Cancel'), 
    146146                        ) ); 
    147                         $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080519' ); 
     147                        $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080422' ); 
    148148                        $this->localize( 'post', 'postL10n', array( 
    149149                                'tagsUsed' =>  __('Tags used on this post:'), 
     
    165165                                        'edit' => __('Edit'), 
    166166                                ) ); 
    167                         $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080109' ); 
     167                        $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080430' ); 
    168168                        $this->localize( 'upload', 'uploadL10n', array( 
    169169                                'browseTitle' => attribute_escape(__('Browse your files')), 
     
    188188                                'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.") 
    189189                        ) ); 
    190