WordPress.org

Make WordPress Core

Changeset 6726


Ignore:
Timestamp:
02/05/2008 06:47:27 AM (14 years ago)
Author:
ryan
Message:

Trailing whitespace cleanup

Location:
trunk
Files:
62 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r6660 r6726  
    304304    if ( !$link_cat = link_cat_row( $term_id ) )
    305305        die('0');
    306        
     306
    307307    $x = new WP_Ajax_Response( array(
    308308        'what' => 'link-cat',
  • trunk/wp-admin/edit-page-form.php

    r6712 r6726  
    4949<div id="titlediv">
    5050<h3><?php _e('Title') ?></h3>
    51 <div class="inside"> 
     51<div class="inside">
    5252  <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" />
    5353</div>
  • trunk/wp-admin/edit-pages.php

    r6380 r6726  
    8888  </thead>
    8989  <tbody id="the-list" class="list:page">
    90   <?php page_rows($posts); ?> 
     90  <?php page_rows($posts); ?>
    9191  </tbody>
    9292</table>
  • trunk/wp-admin/edit-tags.php

    r6723 r6726  
    4343    require_once ('admin-header.php');
    4444    $tag_ID = (int) $_GET['tag_ID'];
    45    
    46     $tag = get_term($tag_ID, 'post_tag', OBJECT, 'edit'); 
     45
     46    $tag = get_term($tag_ID, 'post_tag', OBJECT, 'edit');
    4747    include('edit-tag-form.php');
    4848
  • trunk/wp-admin/export.php

    r6335 r6726  
    55$parent_file = 'edit.php';
    66
    7 if ( isset( $_GET['download'] ) ) { 
     7if ( isset( $_GET['download'] ) ) {
    88    export_wp( $_GET['author'] );
    99    die();
  • trunk/wp-admin/import/blogger.php

    r6607 r6726  
    382382                        $AtomParser->parse( $entry );
    383383                        $result = $this->import_post($AtomParser->entry);
    384                         if ( is_wp_error( $result ) ) 
     384                        if ( is_wp_error( $result ) )
    385385                            return $result;
    386386                        unset($AtomParser);
     
    521521
    522522            $post_id = wp_insert_post($post);
    523             if ( is_wp_error( $post_id ) ) 
     523            if ( is_wp_error( $post_id ) )
    524524                return $post_id;
    525525
  • trunk/wp-admin/import/btt.php

    r6682 r6726  
    6262        echo '<p><h3>'.__('Reading Bunny&#8217;s Technorati Tags&#8230;').'</h3></p>';
    6363
    64         // import Bunny's Keywords tags 
     64        // import Bunny's Keywords tags
    6565        $metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'tags'");
    6666        if ( !is_array($metakeys)) {
  • trunk/wp-admin/import/jkw.php

    r6682 r6726  
    7878        echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>';
    7979
    80         // import Jerome's Keywords tags 
     80        // import Jerome's Keywords tags
    8181        $metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'");
    8282        if ( !is_array($metakeys)) {
     
    118118        echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>';
    119119
    120         // import Jerome's Keywords tags 
     120        // import Jerome's Keywords tags
    121121        $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1);
    122122        $metakeys = $wpdb->get_results("SELECT post_id, tag_name FROM $tablename");
  • trunk/wp-admin/import/mt.php

    r6430 r6726  
    216216            $post->post_author = $this->checkauthor($post->post_author); //just so that if a post already exists, new users are not created by checkauthor
    217217            $post_id = wp_insert_post($post);
    218             if ( is_wp_error( $post_id ) ) 
     218            if ( is_wp_error( $post_id ) )
    219219                return $post_id;
    220220
     
    295295                $context = '';
    296296                $result = $this->save_post($post, $comments, $pings);
    297                 if ( is_wp_error( $result ) ) 
     297                if ( is_wp_error( $result ) )
    298298                    return $result;
    299299                $post = new StdClass;
     
    421421        $this->get_authors_from_post();
    422422        $result = $this->process_posts();
    423         if ( is_wp_error( $result ) ) 
     423        if ( is_wp_error( $result ) )
    424424            return $result;
    425425    }
  • trunk/wp-admin/import/stp.php

    r6430 r6726  
    7171                delete_option('stpimp_posts');
    7272            }
    73            
     73
    7474            add_option('stpimp_posts', $posts);
    7575            $count = count($posts);
     
    8888        echo '<div class="narrow">';
    8989        echo '<p><h3>'.__('Adding Tags to Posts&#8230;').'</h3></p>';
    90        
     90
    9191        // run that funky magic!
    9292        $tags_added = $this->tag2post();
    93        
     93
    9494        echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tags where added!', 'Done! <strong>%s</strong> tags where added!', $tags_added), $tags_added ) . '<br /></p>';
    9595        echo '<form action="admin.php?import=stp&amp;step=3" method="post">';
  • trunk/wp-admin/import/textpattern.php

    r6472 r6726  
    647647            case 3 :
    648648                $result = $this->import_posts();
    649                 if ( is_wp_error( $result ) ) 
     649                if ( is_wp_error( $result ) )
    650650                    echo $result->get_error_message();
    651651                break;
  • trunk/wp-admin/import/wordpress.php

    r6565 r6726  
    1010    var $newauthornames = array ();
    1111    var $allauthornames = array ();
    12    
     12
    1313    var $author_ids = array ();
    1414    var $tags = array ();
    15    
     15
    1616    var $j = -1;
    1717    var $fetch_attachments = false;
     
    5252        return is_callable('gzopen');
    5353    }
    54    
     54
    5555    function fopen($filename, $mode='r') {
    5656        if ( $this->has_gzip() )
     
    5858        return fopen($filename, $mode);
    5959    }
    60    
     60
    6161    function feof($fp) {
    6262        if ( $this->has_gzip() )
     
    6464        return feof($fp);
    6565    }
    66    
     66
    6767    function fgets($fp, $len=8192) {
    6868        if ( $this->has_gzip() )
     
    7070        return fgets($fp, $len);
    7171    }
    72    
     72
    7373    function fclose($fp) {
    7474        if ( $this->has_gzip() )
     
    8787            while ( !$this->feof($fp) ) {
    8888                $importline = rtrim($this->fgets($fp));
    89                
     89
    9090                // this doesn't check that the file is perfectly valid but will at least confirm that it's not the wrong format altogether
    9191                if ( !$is_wxr_file && preg_match('|xmlns:wp="http://wordpress[.]org/export/\d+[.]\d+/"|', $importline) )
     
    124124
    125125    }
    126    
     126
    127127    function get_wp_authors() {
    128128        // We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting.
     
    141141    function get_authors_from_post() {
    142142        global $current_user;
    143        
     143
    144144        // this will populate $this->author_ids with a list of author_names => user_ids
    145        
     145
    146146        foreach ( $_POST['author_in'] as $i => $in_author_name ) {
    147            
     147
    148148            if ( !empty($_POST['user_select'][$i]) ) {
    149149                // an existing user was selected in the dropdown list
     
    154154            elseif ( $this->allow_create_users() ) {
    155155                // nothing was selected in the dropdown list, so we'll use the name in the text field
    156                
     156
    157157                $new_author_name = trim($_POST['user_create'][$i]);
    158158                // if the user didn't enter a name, assume they want to use the same name as in the import file
    159159                if ( empty($new_author_name) )
    160160                    $new_author_name = $in_author_name;
    161                
     161
    162162                $user_id = username_exists($new_author_name);
    163                 if ( !$user_id ) { 
     163                if ( !$user_id ) {
    164164                    $user_id = wp_create_user($new_author_name, 'changeme');
    165165                }
    166                
     166
    167167                $this->author_ids[$in_author_name] = $user_id;
    168168            }
    169            
     169
    170170            // failsafe: if the user_id was invalid, default to the current user
    171171            if ( empty($this->author_ids[$in_author_name]) ) {
     
    173173            }
    174174        }
    175        
     175
    176176    }
    177177
     
    197197            echo '</li>';
    198198        }
    199        
     199
    200200        if ( $this->allow_fetch_attachments() ) {
    201 ?> 
    202 </ol>   
     201?>
     202</ol>
    203203<h2><?php _e('Import Attachments'); ?></h2>
    204204<p>
     
    209209<?php
    210210        }
    211    
     211
    212212        echo '<input type="submit" value="Submit">'.'<br />';
    213213        echo '</form>';
    214214
    215215    }
    216    
     216
    217217    function users_form($n, $author) {
    218        
     218
    219219        if ( $this->allow_create_users() ) {
    220220            printf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user_create['.intval($n).']'.'" maxlength="30"> <br />');
     
    226226        // keep track of $n => $author name
    227227        echo '<input type="hidden" name="author_in['.intval($n).']" value="'.htmlspecialchars($author).'" />';
    228        
     228
    229229        $users = get_users_of_blog();
    230230?><select name="user_select[<?php echo $n; ?>]">
     
    253253    function checkauthor($author) {
    254254        global $current_user;
    255        
     255
    256256        if ( !empty($this->author_ids[$author]) )
    257257            return $this->author_ids[$author];
    258            
     258
    259259        // failsafe: map to the current user
    260260        return $current_user->ID;
     
    335335    function process_post($post) {
    336336        global $wpdb;
    337        
     337
    338338        $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
    339339        if ( $post_ID && !empty($this->post_ids_processed[$post_ID]) ) // Processed already
     
    358358        $post_content = str_replace('<br>', '<br />', $post_content);
    359359        $post_content = str_replace('<hr>', '<hr />', $post_content);
    360        
     360
    361361        preg_match_all('|<category domain="tag">(.*?)</category>|is', $post, $tags);
    362362        $tags = $tags[1];
     
    378378
    379379        $post_exists = post_exists($post_title, '', $post_date);
    380        
     380
    381381        if ( $post_exists ) {
    382382            echo '<li>';
     
    406406                if ( !$remote_url )
    407407                    $remote_url = $guid;
    408                    
     408
    409409                $comment_post_ID = $post_id = $this->process_attachment($postdata, $remote_url);
    410410                if ( !$post_id or is_wp_error($post_id) )
     
    415415                $comment_post_ID = $post_id = wp_insert_post($postdata);
    416416            }
    417            
     417
    418418            if ( is_wp_error( $post_id ) )
    419419                return $post_id;
     
    423423                $this->post_ids_processed[intval($post_ID)] = intval($post_id);
    424424            }
    425            
     425
    426426            // Add categories.
    427427            if (count($categories) > 0) {
     
    496496            $value = $this->get_tag( $p, 'wp:meta_value' );
    497497            $value = stripslashes($value); // add_post_meta() will escape.
    498            
     498
    499499            $this->process_post_meta($post_id, $key, $value);
    500500
    501501        } }
    502        
     502
    503503        do_action('import_post_added', $post_id);
    504504        print "</li>\n";
    505505    }
    506    
     506
    507507    function process_post_meta($post_id, $key, $value) {
    508508        // the filter can return false to skip a particular metadata key
     
    513513        }
    514514    }
    515    
     515
    516516    function process_attachment($postdata, $remote_url) {
    517517        if ($this->fetch_attachments and $remote_url) {
     
    525525                print '('.size_format(filesize($upload['file'])).')';
    526526            }
    527            
     527
    528528            if ( $info = wp_check_filetype($upload['file']) ) {
    529529                $postdata['post_mime_type'] = $info['type'];
     
    533533                return;
    534534            }
    535                
     535
    536536            $postdata['guid'] = $upload['url'];
    537537
     
    539539            $post_id = wp_insert_attachment($postdata, $upload['file']);
    540540            wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
    541            
     541
    542542            // remap the thumbnail url.  this isn't perfect because we're just guessing the original url.
    543543            if ( preg_match('@^image/@', $info['type']) && $thumb_url = wp_get_attachment_thumb_url($post_id) ) {
     
    547547                $this->url_remap[$parts['dirname'] . '/' . $name . '.thumbnail.' . $ext] = $thumb_url;
    548548            }
    549            
     549
    550550            return $post_id;
    551551        }
     
    554554        }
    555555    }
    556    
     556
    557557    function fetch_remote_file($post, $url) {
    558558        $upload = wp_upload_dir($post['post_date']);
    559        
     559
    560560        // extract the file name and extension from the url
    561561        $file_name = basename($url);
     
    567567            return new WP_Error( 'upload_dir_error', $upload['error'] );
    568568        }
    569        
     569
    570570        // fetch the remote url and write it to the placeholder file
    571571        $headers = wp_get_http($url, $upload['file']);
    572        
     572
    573573        // make sure the fetch was successful
    574574        if ( $headers['response'] != '200' ) {
     
    580580            return new WP_Error( 'import_file_error', __('Remote file is incorrect size') );
    581581        }
    582            
     582
    583583        $max_size = $this->max_attachment_size();
    584584        if ( !empty($max_size) and filesize($upload['file']) > $max_size ) {
     
    586586            return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', size_format($max_size))) );
    587587        }
    588            
     588
    589589        // keep track of the old and new urls so we can substitute them later
    590590        $this->url_remap[$url] = $upload['url'];
     
    592592        if ( $headers['x-final-location'] != $url )
    593593            $this->url_remap[$headers['x-final-location']] = $upload['url'];
    594        
     594
    595595        return $upload;
    596        
     596
    597597    }
    598598
     
    601601        return strlen($b) - strlen($a);
    602602    }
    603    
     603
    604604    // update url references in post bodies to point to the new local files
    605605    function backfill_attachment_urls() {
    606        
     606
    607607        // make sure we do the longest urls first, in case one is a substring of another
    608608        uksort($this->url_remap, array(&$this, 'cmpr_strlen'));
    609                
     609
    610610        global $wpdb;
    611611        foreach ($this->url_remap as $from_url => $to_url) {
     
    616616        }
    617617    }
    618    
     618
    619619    // update the post_parent of orphans now that we know the local id's of all parents
    620620    function backfill_parents() {
    621621        global $wpdb;
    622        
     622
    623623        foreach ($this->orphans as $child_id => $parent_id) {
    624624            $local_child_id = $this->post_ids_processed[$child_id];
     
    629629        }
    630630    }
    631    
     631
    632632    function is_valid_meta_key($key) {
    633633        // skip _wp_attached_file metadata since we'll regenerate it from scratch
     
    641641        return apply_filters('import_allow_create_users', true);
    642642    }
    643    
     643
    644644    // give the user the option of downloading and importing attached files
    645645    function allow_fetch_attachments() {
     
    651651        return apply_filters('import_attachment_size_limit', 0);
    652652    }
    653    
     653
    654654    function import_start() {
    655655        wp_defer_term_counting(true);
     
    657657        do_action('import_start');
    658658    }
    659    
     659
    660660    function import_end() {
    661661        do_action('import_end');
    662        
     662
    663663        // clear the caches after backfilling
    664664        foreach ($this->post_ids_processed as $post_id)
    665665            clean_post_cache($post_id);
    666        
     666
    667667        wp_defer_term_counting(false);
    668668        wp_defer_comment_counting(false);
     
    677677        $this->import_file($file);
    678678    }
    679        
     679
    680680    function import_file($file) {
    681681        $this->file = $file;
    682        
     682
    683683        $this->import_start();
    684684        $this->get_authors_from_post();
     
    690690        $this->backfill_attachment_urls();
    691691        $this->import_end();
    692        
     692
    693693        if ( is_wp_error( $result ) )
    694694            return $result;
    695695    }
    696    
     696
    697697    function handle_upload() {
    698698        $file = wp_import_handle_upload();
  • trunk/wp-admin/import/wp-cat2tag.php

    r6551 r6726  
    1 <?php 
     1<?php
    22
    33class WP_Categories_to_Tags {
     
    2020        foreach ( $categories as $category ) {
    2121            if ( !tag_exists($wpdb->escape($category->name)) )
    22                 $this->all_categories[] = $category;   
     22                $this->all_categories[] = $category;
    2323        }
    2424    }
     
    5454        }
    5555        checkflag = 'true';
    56         return '<?php _e('Uncheck All') ?>'; 
     56        return '<?php _e('Uncheck All') ?>';
    5757    } else {
    5858        for ( i = 0; i < field.length; i++ ) {
     
    6161        }
    6262        checkflag = 'false';
    63         return '<?php _e('Check All') ?>'; 
     63        return '<?php _e('Check All') ?>';
    6464    }
    6565}
     
    7777        foreach ($this->all_categories as $category) {
    7878            $category = sanitize_term( $category, 'category', 'display' );
    79        
     79
    8080            if ((int) $category->parent == 0) {
    8181                echo '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>';
     
    165165                    $posts = get_objects_in_term($category->term_id, 'category');
    166166                    foreach ( $posts as $post ) {
    167                         if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") )                       
     167                        if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") )
    168168                            $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post', '$id')");
    169169                        clean_post_cache($post);
  • trunk/wp-admin/includes/dashboard.php

    r6717 r6726  
    5959        array( 'widget_id' => 'dashboard_plugins' )
    6060    );
    61    
     61
    6262
    6363    // Primary feed (Dev Blog) Widget
     
    9292        );
    9393    }
    94     wp_register_sidebar_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_empty', 
     94    wp_register_sidebar_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_empty',
    9595        array( 'all_link' => $widget_options['dashboard_secondary']['link'], 'feed_link' => $widget_options['dashboard_secondary']['url'], 'width' => 'full' )
    9696    );
  • trunk/wp-admin/includes/export.php

    r6383 r6726  
    7575function wxr_site_url() {
    7676    global $current_site;
    77    
     77
    7878    // mu: the base url
    7979    if ( isset($current_site->domain) ) {
  • trunk/wp-admin/includes/image.php

    r6579 r6726  
    2222
    2323    $image = wp_load_image( $file );
    24    
     24
    2525    if ( !is_resource( $image ) )
    2626        return $image;
     
    4040        imagesavealpha( $thumbnail, true);
    4141    }
    42    
     42
    4343    @ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $sourceImageWidth, $sourceImageHeight );
    4444
    45     imagedestroy( $image ); // Free up memory 
     45    imagedestroy( $image ); // Free up memory
    4646
    4747    // If no filters change the filename, we'll do a default transformation.
     
    6868    }
    6969
    70     imagedestroy( $thumbnail ); // Free up memory 
    71    
    72     // Set correct file permissions 
    73     $stat = stat( dirname( $thumbpath )); 
     70    imagedestroy( $thumbnail ); // Free up memory
     71
     72    // Set correct file permissions
     73    $stat = stat( dirname( $thumbpath ));
    7474    $perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executable bits
    75     @ chmod( $thumbpath, $perms ); 
     75    @ chmod( $thumbpath, $perms );
    7676
    7777    return apply_filters( 'wp_create_thumbnail', $thumbpath );
     
    115115
    116116    imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
    117    
    118     imagedestroy( $src ); // Free up memory 
     117
     118    imagedestroy( $src ); // Free up memory
    119119
    120120    if ( ! $dst_file )
     
    160160                $metadata['thumb'] = basename($thumb);
    161161        }
    162        
     162
    163163        // fetch additional metadata from exif/iptc
    164164        $image_meta = wp_read_image_metadata( $file );
  • trunk/wp-admin/includes/media.php

    r6659 r6726  
    1616    $image_align = @$values['image-url'];
    1717    $post_id = $_GET['post_id'];
    18    
     18
    1919?>
    2020<div id="media-upload-header">
     
    3434<!--
    3535
    36 jQuery(document).ready(function(){ 
     36jQuery(document).ready(function(){
    3737    var swfu = new SWFUpload({
    3838            upload_url : "<?php echo get_option('siteurl').'/wp-admin/async-upload.php'; ?>",
     
    6060                cancelButtonId : "btnCancel2"
    6161            },
    62            
     62
    6363            debug: false,
    64        
     64
    6565        });
    6666
     
    108108
    109109function image_upload_handler() {
    110    
     110
    111111    if ( !current_user_can('upload_files') ) {
    112112        return new wp_error( 'upload_not_allowed', __('You are not allowed to upload files.') );
     
    120120        // Add Image button was clicked
    121121        check_admin_referer('inlineuploading');
    122    
     122
    123123        // if the async flash uploader was used, the attachment has already been inserted and its ID is passed in post.
    124124        // otherwise this is a regular form post and we still have to handle the upload and create the attachment.
     
    135135            $id = image_upload_post();
    136136        }
    137        
     137
    138138        // if the input was invalid, redisplay the form with its current values
    139139        if ( is_wp_error($id) )
     
    151151    if ( empty($thumb_url) )
    152152        $thumb_url = wp_mime_type_icon($id);
    153        
     153
    154154    if ($thumb_url) {
    155155        $out = '<p><input type="hidden" name="attachment_id" id="attachment_id" value="'.intval($id).'" />'
     
    161161            . basename(wp_get_attachment_url($id)).'</p>';
    162162    }
    163    
     163
    164164    $post = get_post($id);
    165165    $title = addslashes($post->post_title);
    166166    $alt = addslashes($post->post_content);
    167    
     167
    168168    // populate the input fields with post data (which in turn comes from exif/iptc)
    169169    $out .= <<<EOF
     
    175175jQuery('#image-add').attr('disabled', false);
    176176-->
    177 </script>   
     177</script>
    178178EOF;
    179179
     
    185185
    186186function image_send_to_editor($id, $alt, $title, $align, $url='') {
    187    
     187
    188188    $img_src = wp_get_attachment_url($id);
    189189    $meta = wp_get_attachment_metadata($id);
    190    
     190
    191191    $hwstring = '';
    192192    if ( isset($meta['width'], $meta['height']) )
     
    208208top.tb_remove();
    209209-->
    210 </script>   
     210</script>
    211211    <?php
    212212}
     
    218218    if ( empty($_POST['image-alt']) )
    219219        return new wp_error( 'image_alt_required', __('Please enter an &lt;alt&gt; description') );
    220    
     220
    221221    $overrides = array('test_form'=>false);
    222222    $file = wp_handle_upload($_FILES['image-file'], $overrides);
     
    224224    if ( isset($file['error']) )
    225225        return new wp_error( 'upload_error', $file['error'] );
    226        
     226
    227227    $url = $file['url'];
    228228    $type = $file['type'];
    229229    $file = $file['file'];
    230    
     230
    231231    $post_title = trim($_POST['image-title']);
    232232    $post_content = trim($_POST['image-alt']);
    233233    $post_parent = intval($_POST['parent_post_id']);
    234        
     234
    235235    // Construct the attachment array
    236236    $attachment = array(
     
    248248        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
    249249
    250     return $id;     
     250    return $id;
    251251}
    252252
  • trunk/wp-admin/includes/post.php

    r6712 r6726  
    543543    }
    544544    if (!is_null($name)) {
    545         $post->post_name = sanitize_title($name, $post->ID); 
     545        $post->post_name = sanitize_title($name, $post->ID);
    546546    }
    547547    $permalink = get_permalink($post, true);
     
    566566    $display_link = str_replace('%postname%', $post_name_html, $permalink);
    567567    return $display_link;
    568 } 
     568}
    569569
    570570?>
  • trunk/wp-admin/includes/template.php

    r6713 r6726  
    240240        $count = number_format_i18n( $tag->count );
    241241        $count = ( $count > 0 ) ? "<a href='edit.php?tag=$tag->slug'>$count</a>" : $count;
    242        
     242
    243243        $out = '';
    244244        $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>';
     
    247247        $out .= '<td>' . apply_filters( 'term_name', $tag->name ) . '</td>';
    248248
    249         $out .= "<td>$count</td>";     
     249        $out .= "<td>$count</td>";
    250250        $out .= '<td><a href="edit-tags.php?action=edit&amp;tag_ID=' . $tag->term_id . '" class="edit">' .
    251251            __( 'Edit' ) . "</a></td>" .
    252             '<td><a href="' . wp_nonce_url( "edit-tags.php?action=delete&amp;tag_ID=$tag->term_id", 
    253                     'delete-tag_' . $tag->term_id ) . 
     252            '<td><a href="' . wp_nonce_url( "edit-tags.php?action=delete&amp;tag_ID=$tag->term_id",
     253                    'delete-tag_' . $tag->term_id ) .
    254254                '" class="delete:the-list:tag-' . $tag->term_id . ' delete">' .
    255255                __( 'Delete' ) . "</a></td>";
    256256        $out .= '</tr>';
    257        
     257
    258258        return $out;
    259259}
    260260
    261261// Outputs appropriate rows for the Nth page of the Tag Management screen,
    262 // assuming M tags displayed at a time on the page 
     262// assuming M tags displayed at a time on the page
    263263// Returns the number of tags displayed
    264264function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) {
    265    
     265
    266266    // Get a page worth of tags
    267267    $start = $page * $pagesize;
    268268
    269269    $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);
    270  
     270
    271271    if ( !empty( $searchterms ) ) {
    272272        $args['name__like'] = '%' . like_escape( $searchterms );
     
    274274
    275275    $tags = get_terms( 'post_tag', $args );
    276    
     276
    277277    // convert it to table rows
    278278    $out = '';
     
    292292        $count++;
    293293    }
    294    
     294
    295295    // filter and send to screen
    296296    $out = apply_filters('tag_rows', $out);
     
    331331    global $post;
    332332    static $class;
    333    
     333
    334334    $post = $page;
    335335    setup_postdata($page);
     
    356356
    357357    if ( ! $children_pages )
    358         return true; 
     358        return true;
    359359
    360360    for ( $i = 0; $i < count($children_pages); $i++ ) {
    361361
    362362        $child = $children_pages[$i];
    363            
     363
    364364        if ( $child->post_parent == $id ) {
    365             array_splice($children_pages, $i, 1); 
     365            array_splice($children_pages, $i, 1);
    366366            display_page_row($child, $children_pages, $level+1);
    367367            $i = -1; //as numeric keys in $children_pages are not preserved after splice
     
    371371
    372372/*
    373  * displays pages in hierarchical order 
     373 * displays pages in hierarchical order
    374374 */
    375375function page_rows( $pages ) {
     
    386386
    387387    foreach ( $pages as $page ) {
    388        
    389         // catch and repair bad pages 
     388
     389        // catch and repair bad pages
    390390        if ( $page->post_parent == $page->ID ) {
    391             $page->post_parent = 0; 
     391            $page->post_parent = 0;
    392392            $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
    393393            clean_page_cache( $page->ID );
    394394        }
    395          
     395
    396396        if ( 0 == $page->post_parent )
    397             $top_level_pages[] = $page; 
     397            $top_level_pages[] = $page;
    398398        else
    399             $children_pages[] = $page; 
     399            $children_pages[] = $page;
    400400    }
    401401
    402402    foreach ( $top_level_pages as $page )
    403403        display_page_row($page, $children_pages, 0);
    404    
    405     /* 
     404
     405    /*
    406406     * display the remaining children_pages which are orphans
    407407     * having orphan requires parental attention
    408408     */
    409409     if ( count($children_pages) > 0 ) {
    410         $empty_array = array(); 
    411         foreach ( $children_pages as $orphan_page ) { 
     410        $empty_array = array();
     411        foreach ( $children_pages as $orphan_page ) {
    412412            clean_page_cache( $orphan_page->ID);
    413413            display_page_row( $orphan_page, $empty_array, 0 );
    414         } 
     414        }
    415415     }
    416416}
     
    650650    if ( $for_post )
    651651        $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;
    652    
     652
    653653    $tab_index_attribute = '';
    654654    if ( (int) $tab_index > 0 )
  • trunk/wp-admin/includes/widgets.php

    r6719 r6726  
    5353            if ( !$sidebar || false !== strpos( $widget_control_template, '%i%' ) ) {
    5454                $already_shown[] = $widget['callback']; // it's a multi-widget.  We only need to show it in the list once.
    55                 $action = 'add'; 
     55                $action = 'add';
    5656                $add_url = wp_nonce_url( add_query_arg( array(
    5757                    'sidebar' => $sidebar,
     
    112112
    113113        <?php endforeach; if ( $no_widgets_shown ) : ?>
    114        
     114
    115115        <li><?php _e( 'No matching widgets' ); ?></li>
    116116
  • trunk/wp-admin/install.php

    r6469 r6726  
    7070            wp_die($wpdb->error->get_error_message());
    7171
    72         display_header();   
     72        display_header();
    7373        // Fill in the data we gathered
    7474        $weblog_title = stripslashes($_POST['weblog_title']);
  • trunk/wp-admin/plugins.php

    r6627 r6726  
    140140    <td colspan="3">&nbsp;</td>
    141141    <td colspan="2" style="width:12em;">
    142     <?php 
     142    <?php
    143143    $active = get_option('active_plugins');
    144144    $inactive = get_option('deactivated_plugins');
     
    146146    ?>
    147147    <a href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>" class="delete"><?php _e('Deactivate All Plugins'); ?></a>
    148     <?php 
     148    <?php
    149149    } elseif ( empty($active) && !empty($inactive) ) {
    150150    ?>
  • trunk/wp-admin/setup-config.php

    r6568 r6726  
    1414$configFile = file('../wp-config-sample.php');
    1515
    16 if ( !is_writable('../')) 
     16if ( !is_writable('../'))
    1717    wp_die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
    1818
     
    195195    fclose($handle);
    196196    chmod('../wp-config.php', 0666);
    197    
     197
    198198    display_header();
    199199?>
  • trunk/wp-admin/user-edit.php

    r6700 r6726  
    269269
    270270<?php
    271     if ( $is_profile_page ) { 
     271    if ( $is_profile_page ) {
    272272        do_action('show_user_profile');
    273273    } else {
  • trunk/wp-admin/users.php

    r6615 r6726  
    177177    wp_enqueue_script('admin-users');
    178178    wp_enqueue_script('admin-forms');
    179    
     179
    180180    include('admin-header.php');
    181181
  • trunk/wp-admin/widgets.php

    r6718 r6726  
    2828    </div>
    2929
    30     <div class="wrap"> 
     30    <div class="wrap">
    3131        <p><?php _e( 'You are seeing this message because the theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://automattic.com/code/widgets/themes/">follow these instructions</a>.' ); /* TODO: article on codex */; ?></p>
    3232    </div>
  • trunk/wp-app.php

    r6645 r6726  
    165165        log_app('function','get_service()');
    166166
    167         if( !current_user_can( 'edit_posts' ) ) 
     167        if( !current_user_can( 'edit_posts' ) )
    168168            $this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) );
    169169
     
    199199        log_app('function','get_categories_xml()');
    200200
    201         if( !current_user_can( 'edit_posts' ) ) 
     201        if( !current_user_can( 'edit_posts' ) )
    202202            $this->auth_required( __( 'Sorry, you do not have the right to access this blog.' ) );
    203203
     
    296296
    297297        if( !current_user_can( 'edit_post', $postID ) )
    298             $this->auth_required( __( 'Sorry, you do not have the right to access this post.' ) ); 
     298            $this->auth_required( __( 'Sorry, you do not have the right to access this post.' ) );
    299299
    300300        $this->set_current_entry($postID);
  • trunk/wp-includes/bookmark-template.php

    r6481 r6726  
    4848
    4949    $output = ''; // Blank string to start with.
    50    
     50
    5151    foreach ( (array) $bookmarks as $bookmark ) {
    5252        if ( !isset($bookmark->recently_updated) )
  • trunk/wp-includes/bookmark.php

    r6592 r6726  
    269269 * @param int $bookmark_id Bookmark ID
    270270 * @param string $context How to filter the field value. Either 'raw', 'edit', 'attribute', 'js', 'db', or 'display'
    271  * @return mixed The filtered value 
     271 * @return mixed The filtered value
    272272 */
    273273function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
  • trunk/wp-includes/canonical.php

    r6494 r6726  
    5252    // Some PHP setups turn requests for / into /index.php in REQUEST_URI
    5353    $original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
    54    
     54
    5555    $redirect = $original;
    5656    $redirect_url = false;
  • trunk/wp-includes/classes.php

    r6711 r6726  
    387387}
    388388
    389 /* 
    390  * A class for displaying various tree-like structures. 
     389/*
     390 * A class for displaying various tree-like structures.
    391391 * Extend the Walker class to use it, see examples at the bottom
    392392 */
     
    406406     */
    407407    function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, $output ) {
    408    
     408
    409409        if ( !$element)
    410             return $output; 
    411            
     410            return $output;
     411
    412412        if ( $max_depth != 0 ) {
    413413            if ($depth >= $max_depth)
    414                 return $output; 
    415         }
    416        
     414                return $output;
     415        }
     416
    417417        $id_field = $this->db_fields['id'];
    418418        $parent_field = $this->db_fields['parent'];
    419    
     419
    420420        if ($depth > 0) {
    421421            //start the child delimiter
    422422            $cb_args = array_merge( array($output, $depth), $args);
    423423            $output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
    424         } 
    425            
     424        }
     425
    426426        //display this element
    427427        $cb_args = array_merge( array($output, $element, $depth), $args);
     
    429429
    430430        for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
    431            
     431
    432432            $child = $children_elements[$i];
    433433            if ( $child->$parent_field == $element->$id_field ) {
    434                
     434
    435435                array_splice( $children_elements, $i, 1 );
    436436                $output = $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
    437                 $i = -1; 
     437                $i = -1;
    438438            }
    439439        }
    440        
     440
    441441        //end this element
    442442        $cb_args = array_merge( array($output, $element, $depth), $args);
    443443        $output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
    444        
     444
    445445        if ($depth > 0) {
    446446            //end the child delimiter
     
    448448            $output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
    449449        }
    450        
    451         return $output; 
     450
     451        return $output;
    452452    }
    453453
     
    455455    * displays array of elements hierarchically
    456456    * it is a generic function which does not assume any existing order of elements
    457     * max_depth = -1 means flatly display every element 
    458     * max_depth = 0  means display all levels 
    459     * max_depth > 0  specifies the number of display levels. 
     457    * max_depth = -1 means flatly display every element
     458    * max_depth = 0  means display all levels
     459    * max_depth > 0  specifies the number of display levels.
    460460    */
    461461    function walk( $elements, $max_depth) {
    462    
     462
    463463        $args = array_slice(func_get_args(), 2);
    464464        $output = '';
    465465
    466466        if ($max_depth < -1) //invalid parameter
    467             return $output; 
    468            
     467            return $output;
     468
    469469        if (empty($elements)) //nothing to walk
    470             return $output; 
    471            
     470            return $output;
     471
    472472        $id_field = $this->db_fields['id'];
    473473        $parent_field = $this->db_fields['parent'];
    474    
     474
    475475        // flat display
    476476        if ( -1 == $max_depth ) {
    477             $empty_array = array(); 
    478             foreach ( $elements as $e )     
     477            $empty_array = array();
     478            foreach ( $elements as $e )
    479479                $output = $this->display_element( $e, $empty_array, 1, 0, $args, $output );
    480             return $output; 
    481         }
    482    
    483         /* 
    484          * need to display in hierarchical order 
     480            return $output;
     481        }
     482
     483        /*
     484         * need to display in hierarchical order
    485485         * splice elements into two buckets: those without parent and those with parent
    486486         */
     
    489489        foreach ( $elements as $e) {
    490490            if ( 0 == $e->$parent_field )
    491                 $top_level_elements[] = $e; 
     491                $top_level_elements[] = $e;
    492492            else
    493                 $children_elements[] = $e; 
    494         }
    495        
    496         /* 
     493                $children_elements[] = $e;
     494        }
     495
     496        /*
    497497         * none of the elements is top level
    498498         * the first one must be root of the sub elements
    499499         */
    500500        if ( !$top_level_elements ) {
    501            
     501
    502502            $root = $children_elements[0];
    503503            for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
    504            
     504
    505505                $child = $children_elements[$i];
    506506                if ($root->$parent_field == $child->$parent_field )
    507                     $top_level_elements[] = $child; 
     507                    $top_level_elements[] = $child;
    508508                    array_splice( $children_elements, $i, 1 );
    509                     $i--; 
     509                    $i--;
    510510            }
    511511        }
    512        
     512
    513513        foreach ( $top_level_elements as $e )
    514514            $output = $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
    515            
    516         /* 
    517         * if we are displaying all levels, and remaining children_elements is not empty, 
     515
     516        /*
     517        * if we are displaying all levels, and remaining children_elements is not empty,
    518518        * then we got orphans, which should be displayed regardless
    519519        */
    520520        if ( ( $max_depth == 0 ) && sizeof( $children_elements ) > 0 ) {
    521             $empty_array = array(); 
     521            $empty_array = array();
    522522            foreach ( $children_elements as $orphan_e )
    523523                $output = $this->display_element( $orphan_e, $empty_array, 1, 0, $args, $output );
     
    548548        else
    549549            $indent = '';
    550            
     550
    551551        extract($args, EXTR_SKIP);
    552552        $css_class = 'page_item page-item-'.$page->ID;
     
    750750        $response = '';
    751751        if ( is_wp_error($data) ) {
    752             foreach ( $data->get_error_codes() as $code ) { 
     752            foreach ( $data->get_error_codes() as $code ) {
    753753                $response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message($code) . "]]></wp_error>";
    754754                if ( !$error_data = $data->get_error_data($code) )
  • trunk/wp-includes/comment-template.php

    r6716 r6726  
    131131 * @since 1.5
    132132 * @uses $comment
    133  * @uses apply_filters() 
     133 * @uses apply_filters()
    134134 *
    135135 * @return unknown
     
    167167 *
    168168 * @since 0.71
    169  * @uses apply_filters() 
     169 * @uses apply_filters()
    170170 * @uses get_comment_author_url() Retrieves the comment author's URL
    171171 */
     
    569569
    570570    $_post = get_post($post_id);
    571    
     571
    572572    $open = ( 'open' == $_post->comment_status );
    573573    return apply_filters( 'comments_open', $open, $post_id );
     
    578578 *
    579579 * @since 1.5
    580  * @uses $post 
     580 * @uses $post
    581581 *
    582582 * @param int $post_id An optional post ID to check instead of the current post.
     
    758758    }
    759759    $title = attribute_escape( get_the_title() );
    760    
     760
    761761    echo apply_filters( 'comments_popup_link_attributes', '' );
    762762
  • trunk/wp-includes/comment.php

    r6668 r6726  
    245245    }
    246246
    247     $totals = (array) $wpdb->get_results(" 
    248         SELECT comment_approved, COUNT( * ) AS total 
    249         FROM {$wpdb->comments} 
    250         {$where} 
    251         GROUP BY comment_approved 
     247    $totals = (array) $wpdb->get_results("
     248        SELECT comment_approved, COUNT( * ) AS total
     249        FROM {$wpdb->comments}
     250        {$where}
     251        GROUP BY comment_approved
    252252    ", ARRAY_A);
    253253
    254     $comment_count = array(                         
    255         "approved"              => 0,               
     254    $comment_count = array(
     255        "approved"              => 0,
    256256        "awaiting_moderation"   => 0,
    257257        "spam"                  => 0,
    258258        "total_comments"        => 0
    259     ); 
    260 
    261     foreach ( $totals as $row ) { 
    262         switch ( $row['comment_approved'] ) { 
    263             case 'spam': 
    264                 $comment_count['spam'] = $row['total']; 
     259    );
     260
     261    foreach ( $totals as $row ) {
     262        switch ( $row['comment_approved'] ) {
     263            case 'spam':
     264                $comment_count['spam'] = $row['total'];
    265265                $comment_count["total_comments"] += $row['total'];
    266                 break; 
    267             case 1: 
    268                 $comment_count['approved'] = $row['total']; 
     266                break;
     267            case 1:
     268                $comment_count['approved'] = $row['total'];
    269269                $comment_count['total_comments'] += $row['total'];
    270                 break; 
     270                break;
    271271            case 0:
    272272                $comment_count['awaiting_moderation'] = $row['total'];
     
    789789function wp_defer_comment_counting($defer=null) {
    790790    static $_defer = false;
    791    
     791
    792792    if ( is_bool($defer) ) {
    793793        $_defer = $defer;
     
    796796            wp_update_comment_count( null, true );
    797797    }
    798    
     798
    799799    return $_defer;
    800800}
     
    820820function wp_update_comment_count($post_id, $do_deferred=false) {
    821821    static $_deferred = array();
    822    
     822
    823823    if ( $do_deferred ) {
    824824        $_deferred = array_unique($_deferred);
     
    828828        }
    829829    }
    830    
     830
    831831    if ( wp_defer_comment_counting() ) {
    832832        $_deferred[] = $post_id;
     
    836836        return wp_update_comment_count_now($post_id);
    837837    }
    838        
     838
    839839}
    840840
     
    848848 *
    849849 * @param int $post_id Post ID
    850  * @return bool False on '0' $post_id or if post with ID does not exist. True on success. 
     850 * @return bool False on '0' $post_id or if post with ID does not exist. True on success.
    851851 */
    852852function wp_update_comment_count_now($post_id) {
  • trunk/wp-includes/compat.php

    r6672 r6726  
    7070    else if (strlen($key) < 64)
    7171        $key = str_pad($key, 64, chr(0));
    72        
     72
    7373    $ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64));
    7474    $opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64));
  • trunk/wp-includes/deprecated.php

    r6551 r6726  
    447447 * @param string    $between    Optional. The html to output between the link/image and it's description. Not used if no image or $show_images is true.
    448448 * @param bool      $show_images Optional. Whether to show images (if defined).
    449  * @param string    $orderby    Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner. 
     449 * @param string    $orderby    Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner.
    450450 *      If you start the name with an underscore the order will be reversed. You can also specify 'rand' as the order which will return links in a
    451451 *      random order.
     
    506506 *
    507507 * @param string $cat_name The category name to use. If no match is found uses all.
    508  * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'. 
    509  *      Or maybe owner. If you start the name with an underscore the order will be reversed. You can also 
     508 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'.
     509 *      Or maybe owner. If you start the name with an underscore the order will be reversed. You can also
    510510 *      specify 'rand' as the order which will return links in a random order.
    511511 * @param int $limit Limit to X entries. If not specified, all entries are shown.
     
    559559 * @param int $category The category to use. If no category supplied uses all
    560560 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
    561  *      'description', or 'rating'. Or maybe owner. If you start the name with an 
     561 *      'description', or 'rating'. Or maybe owner. If you start the name with an
    562562 *      underscore the order will be reversed. You can also specify 'rand' as the
    563563 *      order which will return links in a random order.
     
    590590 * @param bool $show_images Whether to show images (if defined).
    591591 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
    592  *      'description', or 'rating'. Or maybe owner. If you start the name with an 
     592 *      'description', or 'rating'. Or maybe owner. If you start the name with an
    593593 *      underscore the order will be reversed. You can also specify 'rand' as the
    594594 *      order which will return links in a random order.
     
    617617 * @param bool $show_images Whether to show images (if defined).
    618618 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url',
    619  *      'description', or 'rating'. Or maybe owner. If you start the name with an 
     619 *      'description', or 'rating'. Or maybe owner. If you start the name with an
    620620 *      underscore the order will be reversed. You can also specify 'rand' as the
    621621 *      order which will return links in a random order.
     
    670670 * @return unknown
    671671 */
    672 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, 
    673                    $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, 
     672function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
     673                   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
    674674                   $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
    675675    _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()');
     
    867867 * @return string
    868868 */
    869 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', 
     869function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',
    870870                    $pagelink='%', $more_file='') {
    871871    _deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()');
     
    10691069 *
    10701070 * @param string $order Sort link categories by 'name' or 'id'
    1071  * @param string $$deprecated Not Used 
     1071 * @param string $$deprecated Not Used
    10721072 */
    10731073function get_links_list($order = 'name', $deprecated = '') {
     
    12151215
    12161216/**
    1217  * get_author_rss_link() - Print/Return link to author RSS feed 
     1217 * get_author_rss_link() - Print/Return link to author RSS feed
    12181218 *
    12191219 * @since 1.2
     
    12361236
    12371237/**
    1238  * comments_rss() - Return link to the post RSS feed 
     1238 * comments_rss() - Return link to the post RSS feed
    12391239 *
    12401240 * @since 1.5
  • trunk/wp-includes/feed-atom-comments.php

    r6493 r6726  
    2626    <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated>
    2727    <?php the_generator( 'atom' ); ?>
    28    
     28
    2929<?php if ( is_singular() ) { ?>
    3030    <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_comments_link() ?>" />
  • trunk/wp-includes/feed.php

    r6711 r6726  
    188188 * @package WordPress
    189189 * @subpackage Feed
    190  * @since 2.4 
     190 * @since 2.4
    191191 *
    192192 * @param string $data input string
  • trunk/wp-includes/formatting.php

    r6680 r6726  
    11161116
    11171117    if ('' == $url) return $url;
    1118     $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@()]|i', '', $url); 
     1118    $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@()]|i', '', $url);
    11191119    $strip = array('%0d', '%0a');
    11201120    $url = str_replace($strip, '', $url);
  • trunk/wp-includes/functions.php

    r6669 r6726  
    554554    else
    555555        $request_type = 'HEAD';
    556        
     556
    557557    $head = "$request_type $file HTTP/1.1\r\nHOST: $host\r\nUser-Agent: WordPress/" . $wp_version . "\r\n\r\n";
    558558
     
    580580                return wp_get_http( $headers['location'], $file_path, ++$red );
    581581        }
    582    
     582
    583583    // make a note of the final location, so the caller can tell if we were redirected or not
    584584    $headers['x-final-location'] = $url;
     
    589589        return $headers;
    590590    }
    591    
     591
    592592    // GET request - fetch and write it to the supplied filename
    593593    $content_length = $headers['content-length'];
     
    602602            break;
    603603    }
    604    
     604
    605605    fclose($out_fp);
    606606    fclose($fp);
     
    948948    global $wpdb;
    949949
    950     // Check cache first.  If options table goes away and we have true cached, oh well. 
     950    // Check cache first.  If options table goes away and we have true cached, oh well.
    951951    if ( wp_cache_get('is_blog_installed') )
    952952        return true;
     
    995995    if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
    996996        return $_REQUEST['_wp_http_referer'];
    997     else if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) 
     997    else if ( ! empty( $_SERVER['HTTP_REFERER'] ) )
    998998        return $_SERVER['HTTP_REFERER'];
    999999    return false;
     
    10691069// return a filename that is sanitized and unique for the given directory
    10701070function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) {
    1071    
     1071
    10721072    // separate the filename into a name and extension
    10731073    $info = pathinfo($filename);
    10741074    $ext = $info['extension'];
    10751075    $name = basename($filename, ".{$ext}");
    1076    
     1076
    10771077    // Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
    10781078    if ( $unique_filename_callback && function_exists( $unique_filename_callback ) ) {
     
    10961096        $filename = sanitize_title_with_dashes( $filename ) . $ext;
    10971097    }
    1098    
     1098
    10991099    return $filename;
    11001100}
     
    11121112    if ( $upload['error'] !== false )
    11131113        return $upload;
    1114    
     1114
    11151115    $filename = wp_unique_filename( $upload['path'], $name );
    11161116
     
    12261226        $trans['delete']['bookmark']   = array( __( 'Are you sure you want to delete this link: &quot;%s&quot;?' ), 'use_id' );
    12271227        $trans['update']['bookmark']   = array( __( 'Are you sure you want to edit this link: &quot;%s&quot;?' ), 'use_id' );
    1228         $trans['bulk']['bookmarks']    = array( __( 'Are you sure you want to bulk modify links?' ), false ); 
     1228        $trans['bulk']['bookmarks']    = array( __( 'Are you sure you want to bulk modify links?' ), false );
    12291229
    12301230        $trans['add']['page']          = array( __( 'Are you sure you want to add this page?' ), false );
     
    13231323    }
    13241324
    1325     if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL ) 
    1326         $admin_dir = WP_SITEURL . '/wp-admin/'; 
     1325    if ( defined( 'WP_SITEURL' ) && '' != WP_SITEURL )
     1326        $admin_dir = WP_SITEURL . '/wp-admin/';
    13271327    elseif ( function_exists( 'get_bloginfo' ) && '' != get_bloginfo( 'wpurl' ) )
    1328         $admin_dir = get_bloginfo( 'wpurl' ) . '/wp-admin/'; 
     1328        $admin_dir = get_bloginfo( 'wpurl' ) . '/wp-admin/';
    13291329    elseif ( strpos( $_SERVER['PHP_SELF'], 'wp-admin' ) !== false )
    13301330        $admin_dir = '';
     
    15561556<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    15571557    <title>Database Error</title>
    1558    
     1558
    15591559</head>
    15601560<body>
     
    16131613 * _deprecated_function() - Marks a function as deprecated and informs when it has been used.
    16141614 *
    1615  * There is a hook deprecated_function_run that will be called that can be used to get the backtrace 
     1615 * There is a hook deprecated_function_run that will be called that can be used to get the backtrace
    16161616 * up to what file and function called the deprecated function.
    16171617 *
    16181618 * The current behavior is to trigger an user error if WP_DEBUG is defined and is true.
    1619  * 
     1619 *
    16201620 * This function is to be used in every function in depreceated.php
    16211621 *
     
    16481648 * _deprecated_file() - Marks a file as deprecated and informs when it has been used.
    16491649 *
    1650  * There is a hook deprecated_file_included that will be called that can be used to get the backtrace 
     1650 * There is a hook deprecated_file_included that will be called that can be used to get the backtrace
    16511651 * up to what file and function included the deprecated file.
    16521652 *
    16531653 * The current behavior is to trigger an user error if WP_DEBUG is defined and is true.
    1654  * 
     1654 *
    16551655 * This function is to be used in every file that is depreceated
    16561656 *
  • trunk/wp-includes/general-template.php

    r6694 r6726  
    196196    if ( !empty($tag) ) {
    197197        $tag = get_term($tag, 'post_tag', OBJECT, 'display');
    198         if ( is_wp_error( $tag ) ) 
     198        if ( is_wp_error( $tag ) )
    199199            return $tag;
    200200        if ( ! empty($tag->name) )
     
    243243    else
    244244        $title = $prefix . $title;
    245    
     245
    246246    $title = apply_filters('wp_title', $title, $sep);
    247247
     
    298298    if ( !empty($tag_id) ) {
    299299        $my_tag = &get_term($tag_id, 'post_tag', OBJECT, 'display');
    300         if ( is_wp_error( $my_tag ) ) 
     300        if ( is_wp_error( $my_tag ) )
    301301            return false;
    302302        $my_tag_name = apply_filters('single_tag_title', $my_tag->name);
     
    934934            add_filter('the_editor_content', 'wp_richedit_pre');
    935935
    936         //  The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it. 
    937         ?> 
     936        //  The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it.
     937        ?>
    938938    <style type="text/css">
    939939        #postdivrich table, #postdivrich #quicktags {border-top: none;}
    940940        #quicktags {border-bottom: none; padding-bottom: 2px; margin-bottom: -1px;}
    941941    </style>
    942    
     942
    943943    <div id='editor-toolbar' style='display:none;'>
    944944        <div class='zerosize'><input accesskey='e' type='button' onclick='switchEditors.go("<?php echo $id; ?>")' /></div>
     
    10181018    $attributes = array();
    10191019    $output = '';
    1020        
     1020
    10211021    if ( $dir = get_bloginfo('text_direction') )
    10221022        $attributes[] = "dir=\"$dir\"";
    1023    
     1023
    10241024    if ( $lang = get_bloginfo('language') ) {
    10251025        if ( get_option('html_type') == 'text/html' || $doctype == 'xhtml' )
    10261026            $attributes[] = "lang=\"$lang\"";
    1027        
     1027
    10281028        if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' )
    10291029            $attributes[] = "xml:lang=\"$lang\"";
    10301030    }
    1031    
     1031
    10321032    $output = implode(' ', $attributes);
    10331033    $output = apply_filters('language_attributes', $output);
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php

    r6632 r6726  
    2121     *
    2222     * @param $args.. Arguments.
    23      * @return {Array} Array of all input arguments. 
     23     * @return {Array} Array of all input arguments.
    2424     */
    2525    function &loopback(/* args.. */) {
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r6694 r6726  
    2525    $valid_elements = '*[*]';
    2626    $valid_elements = apply_filters('mce_valid_elements', $valid_elements);
    27    
     27
    2828    $invalid_elements = apply_filters('mce_invalid_elements', '');
    2929
     
    4141    $mce_buttons_3 = apply_filters('mce_buttons_3', array());
    4242    $mce_buttons_3 = implode($mce_buttons_3, ',');
    43    
     43
    4444    $mce_buttons_4 = apply_filters('mce_buttons_4', array());
    4545    $mce_buttons_4 = implode($mce_buttons_4, ',');
  • trunk/wp-includes/js/tinymce/tiny_mce_gzip.php

    r6694 r6726  
    1313//error_reporting(E_ALL);
    1414    @require_once('../../../wp-config.php');  // For get_bloginfo().
    15    
     15
    1616    // Headers
    1717    $expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
     
    7373    $suffix = getParam( 'suffix', '_src' ) == '_src' ? '_src' : '';
    7474    $cachePath = realpath('.'); // Cache path, this is where the .gz files will be stored
    75    
     75
    7676    $content = '';
    7777    $encodings = array();
     
    7979    $enc = '';
    8080    $cacheKey = '';
    81    
     81
    8282    // WP. Language handling could be improved... Concat all translated langs files and store in /wp-content/languages as .mo?
    8383    $theme = getParam( 'theme', 'advanced' );
    8484    $themes = array($theme);
    85    
     85
    8686    $language = getParam( 'language', 'en' );
    8787    $languages = array($language);
    88    
     88
    8989    if ( $language != strtolower($language) )
    9090        $languages[] = strtolower($language);
    91    
     91
    9292    if ( $language != substr($language, 0, 2) )
    9393        $languages[] = substr($language, 0, 2);
    94    
     94
    9595    $diskCache = false;
    9696    $isJS = true;
     
    159159    foreach ( $languages as $lang )
    160160        $lang_content .= getFileContents('langs/' . $lang . '.js');
    161    
     161
    162162    if ( empty($lang_content) && file_exists('langs/en.js') )
    163163        $lang_content .= getFileContents('langs/en.js');
    164    
     164
    165165    $content .= $lang_content;
    166166
     
    172172        foreach ( $languages as $lang )
    173173            $lang_content .= getFileContents( 'themes/' . $theme . '/langs/' . $lang . '.js' );
    174        
     174
    175175        if ( empty($lang_content) && file_exists( 'themes/' . $theme . '/langs/en.js' ) )
    176176            $lang_content .= getFileContents( 'themes/' . $theme . '/langs/en.js' );
    177        
     177
    178178        $content .= $lang_content;
    179179    }
     
    186186        foreach ( $languages as $lang )
    187187            $lang_content .= getFileContents( 'plugins/' . $plugin . '/langs/' . $lang . '.js' );
    188        
     188
    189189        if ( empty($lang_content) && file_exists( 'plugins/' . $plugin . '/langs/en.js' ) )
    190190            $lang_content .= getFileContents( 'plugins/' . $plugin . '/langs/en.js' );
    191        
     191
    192192        $content .= $lang_content;
    193193    }
     
    236236        suffix : ''
    237237    },
    238    
     238
    239239    opt : {},
    240    
     240
    241241    init : function(arr, cb) {
    242242        var t = this, n, s, nl = document.getElementsByTagName('script');
    243        
     243
    244244        t.opt = arr;
    245245
    246246        t.settings.themes = arr.theme;
    247         t.settings.plugins = arr.plugins; 
     247        t.settings.plugins = arr.plugins;
    248248        t.settings.languages = arr.language;
    249249        s = t.settings;
     
    257257        }
    258258        tinyMCEPreInit.base = t.baseURL;
    259        
     259
    260260        if (!t.coreLoaded)
    261261            t.loadScripts(1, s.themes, s.plugins, s.languages);
     
    275275            return x;
    276276        };
    277        
     277
    278278        // Build query string
    279279        q = 'load=true&js=true&diskcache=' + (s.disk_cache ? 'true' : 'false') + '&core=' + (co ? 'true' : 'false') + '&suffix=' + escape(s.suffix) + '&themes=' + escape(th) + '&plugins=' + escape(pl) + '&languages=' + escape(la);
     
    281281        if (co)
    282282            t.coreLoaded = 1;
    283    
     283
    284284    // Easier to debug with this...
    285285    //  document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + t.baseURL + '/' + s.page_name + '?' + q + '"></script>');
  • trunk/wp-includes/js/tinymce/wp-mce-help.php

    r6694 r6726  
    130130        }
    131131    }
    132    
     132
    133133    function init() {
    134134        document.getElementById('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;
     
    136136    }
    137137    tinyMCEPopup.onInit.add(init);
    138    
     138
    139139    // For modal dialogs in IE
    140140    if (tinymce.isIE)
     
    191191<div id="content4" class="hidden">
    192192    <h2><?php _e('About TinyMCE'); ?></h2>
    193    
     193
    194194    <p><?php _e('Version:'); ?> <span id="version"></span> (<span id="date"></span>)</p>
    195195    <p><?php printf(__('TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under %sLGPL</a> by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '<a href="'.get_bloginfo('url').'/wp-includes/js/tinymce/license.txt" target="_blank" title="'.__('GNU Library General Public Licence').'">') ?></p>
  • trunk/wp-includes/l10n.php

    r6585 r6726  
    153153 * @since 1.2.0
    154154 * @uses $l10n Gets list of domain translated string (gettext_reader) objects
    155  * @uses apply_filters() Calls 'ngettext' hook on domains text returned, 
     155 * @uses apply_filters() Calls 'ngettext' hook on domains text returned,
    156156 *      along with $single, $plural, and $number parameters. Expected to return string.
    157157 *
  • trunk/wp-includes/link-template.php

    r6711 r6726  
    341341function get_category_feed_link($cat_id, $feed = '') {
    342342    $cat_id = (int) $cat_id;
    343    
     343
    344344    $category = get_category($cat_id);
    345    
     345
    346346    if ( empty($category) || is_wp_error($category) )
    347347        return false;
     
    360360        else
    361361            $feed_link = "feed/$feed";
    362        
     362
    363363        $link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
    364364    }
    365365
    366366    $link = apply_filters('category_feed_link', $link, $feed);
    367    
     367
    368368    return $link;
    369369}
     
    403403    else
    404404        $search = attribute_escape(stripslashes($search_query));
    405    
     405
    406406    if ( empty($feed) )
    407407        $feed = get_default_feed();
    408    
     408
    409409    $link = get_option('home') . "?s=$search&amp;feed=$feed";
    410    
     410
    411411    $link = apply_filters('search_feed_link', $link);
    412    
     412
    413413    return $link;
    414414}
     
    419419    else
    420420        $search = attribute_escape(stripslashes($search_query));
    421    
     421
    422422    if ( empty($feed) )
    423423        $feed = get_default_feed();
    424    
     424
    425425    $link = get_option('home') . "?s=$search&amp;feed=comments-$feed";
    426    
     426
    427427    $link = apply_filters('search_feed_link', $link);
    428    
     428
    429429    return $link;
    430430}
  • trunk/wp-includes/pluggable.php

    r6711 r6726  
    505505    $key = wp_hash($username . $expiration);
    506506    $hash = hash_hmac('md5', $username . $expiration, $key);
    507    
     507
    508508    if ( $hmac != $hash )
    509509        return false;
     
    587587    setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
    588588    setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
    589     setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); 
     589    setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
    590590}
    591591endif;
     
    759759 *
    760760 * @since 2.3
    761  * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing 
     761 * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing
    762762 *      WordPress host string and $location host string.
    763763 *
     
    10881088        $wp_hasher = new PasswordHash(8, TRUE);
    10891089    }
    1090    
    1091     return $wp_hasher->HashPassword($password); 
     1090
     1091    return $wp_hasher->HashPassword($password);
    10921092}
    10931093endif;
  • trunk/wp-includes/plugin.php

    r6629 r6726  
    165165
    166166    } while ( next($wp_filter[$tag]) !== false );
    167    
     167
    168168    array_pop( $wp_current_filter );
    169169
     
    505505}
    506506
    507 /** 
     507/**
    508508 * _wp_call_all_hook() - Calls the 'all' hook, which will process the functions hooked into it.
    509509 *
     
    524524 * @param array $args The collected parameters from the hook that was called.
    525525 * @param string $hook Optional. The hook name that was used to call the 'all' hook.
    526  */ 
    527 function _wp_call_all_hook($args) { 
    528     global $wp_filter; 
     526 */
     527function _wp_call_all_hook($args) {
     528    global $wp_filter;
    529529
    530530    reset( $wp_filter['all'] );
  • trunk/wp-includes/post.php

    r6657 r6726  
    10331033        $guid = get_post_field( 'guid', $post_ID );
    10341034    }
    1035    
     1035
    10361036    // Create a valid post name.  Drafts are allowed to have an empty
    10371037    // post name.
  • trunk/wp-includes/query.php

    r6704 r6726  
    3838
    3939function is_admin () {
    40     if ( defined('WP_ADMIN') ) 
     40    if ( defined('WP_ADMIN') )
    4141        return WP_ADMIN;
    4242    return false;
     
    144144 * @return bool True if front of site
    145145 */
    146 function is_front () { 
    147     // most likely case 
    148     if ( 'posts' == get_option('show_on_front') && is_home() ) 
    149         return true; 
    150     elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) ) 
    151         return true; 
    152     else 
    153         return false; 
    154 } 
     146function is_front () {
     147    // most likely case
     148    if ( 'posts' == get_option('show_on_front') && is_home() )
     149        return true;
     150    elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) )
     151        return true;
     152    else
     153        return false;
     154}
    155155
    156156/**
     
    186186
    187187    $page = (array) $page;
    188    
     188
    189189    if ( in_array( $page_obj->ID, $page ) )
    190190        return true;
     
    978978        if ( !empty($q['category__not_in']) ) {
    979979            $ids = get_objects_in_term($q['category__not_in'], 'category');
    980             if ( is_wp_error( $ids ) ) 
     980            if ( is_wp_error( $ids ) )
    981981                return $ids;
    982982            if ( is_array($ids) && count($ids > 0) ) {
     
    11661166                    $q['orderby'] .= (($i == 0) ? '' : ',') . $orderby;
    11671167            }
    1168             /* append ASC or DESC at the end */ 
     1168            /* append ASC or DESC at the end */
    11691169            if ( !empty($q['orderby'])){
    11701170                $q['orderby'] .= " {$q['order']}";
    11711171            }
    1172            
     1172
    11731173            if ( empty($q['orderby']) )
    11741174                $q['orderby'] = 'post_date '.$q['order'];
  • trunk/wp-includes/rewrite.php

    r6614 r6726  
    294294        if ( !$posts )
    295295            return array( array(), array() );
    296    
     296
    297297
    298298        foreach ($posts as $id => $post) {
  • trunk/wp-includes/script-loader.php

    r6713 r6726  
    105105                'file_cancelled' => 'File cancelled.',
    106106                'upload_stopped' => 'Upload stopped.',
    107                
     107
    108108        ) );
    109109
     
    119119            $this->add( 'admin-tags', '/wp-admin/js/tags.js', array('wp-lists'), '20071031' );
    120120            $this->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('wp-lists'), '20070823' );
    121             $this->add( 'password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20070405' ); 
    122             $this->localize( 'password-strength-meter', 'pwsL10n', array( 
    123                 'short' => __('Too short'), 
    124                 'bad' => __('Bad'), 
    125                 'good' => __('Good'), 
    126                 'strong' => __('Strong') 
     121            $this->add( 'password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20070405' );
     122            $this->localize( 'password-strength-meter', 'pwsL10n', array(
     123                'short' => __('Too short'),
     124                'bad' => __('Bad'),
     125                'good' => __('Good'),
     126                'strong' => __('Strong')
    127127            ) );
    128128            $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20071104' );
     
    275275                else
    276276                    continue; // We're at the top level.  Move on to the next one.
    277             }                   
     277            }
    278278
    279279            $this->to_print[$handle] = true;
  • trunk/wp-includes/shortcodes.php

    r6659 r6726  
    3131        'baz' => 'default baz',
    3232    ), $atts));
    33    
     33
    3434    return "foo = {$foo}";
    3535}
  • trunk/wp-includes/streams.php

    r6554 r6726  
    66 * @subpackage PHP-gettext
    77 *
    8  * @internal 
     8 * @internal
    99   Copyright (c) 2003, 2005 Danilo Segan <danilo@kvota.net>.
    1010
  • trunk/wp-includes/taxonomy.php

    r6660 r6726  
    3232 * @subpackage Taxonomy
    3333 * @since 2.3
    34  * 
     34 *
    3535 * @uses $wp_taxonomies
    3636 *
     
    8181 * @subpackage Taxonomy
    8282 * @since 2.3
    83  * 
     83 *
    8484 * @uses $wp_taxonomies
    8585 *
     
    140140 * @since 2.3
    141141 * @uses $wp_taxonomies Inserts new taxonomy object into the list
    142  * 
     142 *
    143143 * @param string $taxonomy Name of taxonomy object
    144144 * @param string $object_type Name of the object type for the taxonomy object.
     
    276276        }
    277277    }
    278    
     278
    279279    $_term = apply_filters('get_term', $_term, $taxonomy);
    280280    $_term = apply_filters("get_$taxonomy", $_term, $taxonomy);
     
    363363 *
    364364 * Will return an empty array if $term does not exist in $taxonomy.
    365  * 
     365 *
    366366 * @package WordPress
    367367 * @subpackage Taxonomy
     
    397397/**
    398398 * get_term_field() - Get sanitized Term field
    399  * 
     399 *
    400400 * Does checks for $term, based on the $taxonomy. The function is for
    401401 * contextual reasons and for simplicity of usage. See sanitize_term_field() for
     
    434434 * Return value is sanitize_term() and usage is for sanitizing the term
    435435 * for editing. Function is for contextual and simplicity.
    436  * 
     436 *
    437437 * @package WordPress
    438438 * @subpackage Taxonomy
     
    630630        if( $offset )
    631631            $number = 'LIMIT ' . $offset . ',' . $number;
    632         else 
     632        else
    633633            $number = 'LIMIT ' . $number;
    634        
     634
    635635    } else
    636636        $number = '';
     
    810810        if ( 'slug' == $field )
    811811            $value = apply_filters('pre_category_nicename', $value);
    812            
     812
    813813    } else if ( 'rss' == $context ) {
    814814        $value = apply_filters("term_${field}_rss", $value, $taxonomy);
     
    10331033    else if ( 'ids' == $fields )
    10341034        $select_this = 't.term_id';
    1035     else if ( 'names' == $fields ) 
     1035    else if ( 'names' == $fields )
    10361036        $select_this = 't.name';
    10371037    else if ( 'all_with_object_id' == $fields )
     
    11761176/**
    11771177 * wp_set_object_terms() - Create Term and Taxonomy Relationships
    1178  * 
     1178 *
    11791179 * Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy
    11801180 * relationship if it doesn't already exist. Creates a term if it doesn't exist (using the slug).
     
    12141214        if ( !strlen(trim($term)) )
    12151215            continue;
    1216        
     1216
    12171217        if ( !$id = is_term($term, $taxonomy) )
    12181218            $id = wp_insert_term($term, $taxonomy);
     
    12441244/**
    12451245 * wp_unique_term_slug() - Will make slug unique, if it isn't already
    1246  * 
     1246 *
    12471247 * The $slug has to be unique global to every taxonomy, meaning that one taxonomy
    12481248 * term can't have a matching slug with another taxonomy term. Each slug has to be
     
    12541254 * If that still doesn't return an unique slug, then it try to append a number until
    12551255 * it finds a number that is truely unique.
    1256  * 
     1256 *
    12571257 * The only purpose for $term is for appending a parent, if one exists.
    12581258 *
     
    14211421function wp_defer_term_counting($defer=NULL) {
    14221422    static $_defer = false;
    1423    
     1423
    14241424    if ( is_bool($defer) ) {
    14251425        $_defer = $defer;
     
    14281428            wp_update_term_count( NULL, NULL, true );
    14291429    }
    1430    
     1430
    14311431    return $_defer;
    14321432}
     
    14341434/**
    14351435 * wp_update_term_count() - Updates the amount of terms in taxonomy
    1436  * 
     1436 *
    14371437 * If there is a taxonomy callback applyed, then it will be called for updating the count.
    14381438 *
     
    14711471        return true;
    14721472    }
    1473    
     1473
    14741474    return wp_update_term_count_now( $terms, $taxonomy );
    14751475}
     
    16011601 *
    16021602 * It should be noted that update_object_term_cache() is very time extensive.
    1603  * It is advised that the function is not called very often or at least not 
     1603 * It is advised that the function is not called very often or at least not
    16041604 * for a lot of terms that exist in a lot of taxonomies. The amount of time
    16051605 * increases for each term and it also increases for each taxonomy the term
     
    16131613 * @param string|array $object_ids Single or list of term object ID(s)
    16141614 * @param string $object_type The taxonomy object type
    1615  * @return null|bool Null value is given with empty $object_ids. False if 
     1615 * @return null|bool Null value is given with empty $object_ids. False if
    16161616 */
    16171617function update_object_term_cache($object_ids, $object_type) {
     
    17201720/**
    17211721 * _get_term_children() - Get array of child terms
    1722  * 
     1722 *
    17231723 * If $terms is an array of objects, then objects will returned from the function.
    17241724 * If $terms is an array of IDs, then an array of ids of children will be returned.
     
    17761776/**
    17771777 * _pad_term_counts() - Add count of children to parent count
    1778  * 
     1778 *
    17791779 * Recalculates term counts by including items from child terms.
    17801780 * Assumes all relevant children are already in the $terms argument
     
    18271827    }
    18281828
    1829     // Transfer the touched cells 
     1829    // Transfer the touched cells
    18301830    foreach ( (array) $term_items as $id => $items )
    18311831        if ( isset($terms_by_id[$id]) )
     
    18391839/**
    18401840 * _update_post_term_count() - Will update term count based on posts
    1841  * 
     1841 *
    18421842 * Private function for the default callback for post_tag and category taxonomies.
    18431843 *
  • trunk/wp-includes/update.php

    r6297 r6726  
    1010 * wp_version_check() - Check WordPress version against the newest version.
    1111 *
    12  * The WordPress version, PHP version, and Locale is sent. Checks against the WordPress server at 
     12 * The WordPress version, PHP version, and Locale is sent. Checks against the WordPress server at
    1313 * api.wordpress.org server. Will only check if PHP has fsockopen enabled and WordPress isn't installing.
    1414 *
  • trunk/wp-includes/user.php

    r6711 r6726  
    2323    if ( empty($credentials['user_login']) && empty($credentials['user_password']) ) {
    2424            $user = wp_validate_auth_cookie();
    25             if ( $user ) 
     25            if ( $user )
    2626                return new WP_User($user);
    2727
     
    158158    }
    159159
    160     foreach ($metas as $meta) 
     160    foreach ($metas as $meta)
    161161        $values[] = maybe_unserialize($meta->meta_value);
    162162
  • trunk/wp-includes/widgets.php

    r6717 r6726  
    731731    if ( !$updated && !empty($_POST['sidebar']) ) {
    732732        $sidebar = (string) $_POST['sidebar'];
    733        
     733
    734734        $sidebars_widgets = wp_get_sidebars_widgets();
    735735        if ( isset($sidebars_widgets[$sidebar]) )
     
    737737        else
    738738            $this_sidebar = array();
    739        
     739
    740740        foreach ( $this_sidebar as $_widget_id ) {
    741741            if ( 'wp_widget_categories' == $wp_registered_widgets[$_widget_id]['callback'] && isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) ) {
    742742                $widget_number = $wp_registered_widgets[$_widget_id]['params'][0]['number'];
    743743                unset($options[$widget_number]);
    744             }   
     744            }
    745745        }
    746746
     
    772772            <p>
    773773                <label for="categories-title-<?php echo $number; ?>">
    774                     <?php _e( 'Title:' ); ?> 
     774                    <?php _e( 'Title:' ); ?>
    775775                    <input class="widefat" id="categories-title-<?php echo $number; ?>" name="widget-categories[<?php echo $number; ?>][title]" type="text" value="<?php echo $title; ?>" />
    776776                </label>
     
    11561156        else
    11571157            $this_sidebar = array();
    1158    
     1158
    11591159        foreach ( $this_sidebar as $_widget_id ) {
    11601160            if ( 'wp_widget_rss' == $wp_registered_widgets[$_widget_id]['callback'] && isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) ) {
     
    12841284            $link = clean_url(strip_tags($rss->channel['link']));
    12851285            while ( strstr($link, 'http') != $link )
    1286                 $link = substr($link, 1);           
     1286                $link = substr($link, 1);
    12871287        }
    12881288    }
     
    14011401    $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );
    14021402    extract( $widget_args, EXTR_SKIP );
    1403    
     1403
    14041404    // Data should be stored as array:  array( number => data for that instance of the widget, ... )
    14051405    $options = get_option('widget_many');
  • trunk/wp-includes/wp-db.php

    r6711 r6726  
    529529            elseif ( strtolower(@$trace['function']) == 'do_action' )
    530530                continue;
    531    
     531
    532532            $caller = $trace['function'];
    533533            break;
  • trunk/wp-login.php

    r6711 r6726  
    6565    if ( $errors->get_error_code() )
    6666        return $errors;
    67    
     67
    6868    if ( !$user_data ) {
    6969        $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
     
    171171}
    172172
    173 // 
     173//
    174174// Main
    175175//
     
    243243<p id="nav">
    244244<?php if (get_option('users_can_register')) : ?>
    245 <a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Log in') ?></a> | 
     245<a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Log in') ?></a> |
    246246<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register"><?php _e('Register') ?></a>
    247247<?php else : ?>
     
    312312
    313313<p id="nav">
    314 <a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Log in') ?></a> | 
     314<a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Log in') ?></a> |
    315315<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
    316316</p>
     
    337337        // If the user can't edit posts, send them to their profile.
    338338        if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
    339             $redirect_to = get_option('siteurl') . '/wp-admin/profile.php'; 
     339            $redirect_to = get_option('siteurl') . '/wp-admin/profile.php';
    340340        wp_safe_redirect($redirect_to);
    341341        exit();
    342342    }
    343    
     343
    344344    $errors = $user;
    345345    // Clear errors if loggedout is set.
  • trunk/wp-settings.php

    r6684 r6726  
    175175if ( !defined('LANGDIR') ) {
    176176    /**
    177      * Stores the location of the language directory. First looks for language folder in wp-content 
     177     * Stores the location of the language directory. First looks for language folder in wp-content
    178178     * and uses that folder if it exists. Or it uses the "languages" folder in WPINC.
    179179     *
  • trunk/xmlrpc.php

    r6714 r6726  
    3232      <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" />
    3333      <api name="Blogger" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" />
    34       <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', (get_bloginfo('url')."/wp-app.php/service"))?>" /> 
     34      <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', (get_bloginfo('url')."/wp-app.php/service"))?>" />
    3535    </apis>
    3636  </service>
     
    175175    }
    176176
    177     function get_custom_fields($post_id) { 
    178         $post_id = (int) $post_id; 
    179 
    180         $custom_fields = array(); 
    181 
    182         foreach ( (array) has_meta($post_id) as $meta ) { 
    183             // Don't expose protected fields. 
    184             if ( strpos($meta['meta_key'], '_wp_') === 0 ) { 
    185                 continue; 
    186             } 
    187 
    188             $custom_fields[] = array( 
    189                 "id"    => $meta['meta_id'], 
    190                 "key"   => $meta['meta_key'], 
    191                 "value" => $meta['meta_value'] 
    192             ); 
    193         } 
    194 
    195         return $custom_fields; 
    196     } 
    197 
    198     function set_custom_fields($post_id, $fields) { 
    199         $post_id = (int) $post_id; 
    200 
    201         foreach ( (array) $fields as $meta ) { 
    202             if ( isset($meta['id']) ) { 
    203                 $meta['id'] = (int) $meta['id']; 
    204 
    205                 if ( isset($meta['key']) ) { 
    206                     update_meta($meta['id'], $meta['key'], $meta['value']); 
    207                 } 
    208                 else { 
    209                     delete_meta($meta['id']); 
    210                 } 
    211             } 
    212             else { 
    213                 $_POST['metakeyinput'] = $meta['key']; 
    214                 $_POST['metavalue'] = $meta['value']; 
    215                 add_meta($post_id); 
    216             } 
    217         } 
    218     } 
     177    function get_custom_fields($post_id) {
     178        $post_id = (int) $post_id;
     179
     180        $custom_fields = array();
     181
     182        foreach ( (array) has_meta($post_id) as $meta ) {
     183            // Don't expose protected fields.
     184            if ( strpos($meta['meta_key'], '_wp_') === 0 ) {
     185                continue;
     186            }
     187
     188            $custom_fields[] = array(
     189                "id"    => $meta['meta_id'],
     190                "key"   => $meta['meta_key'],
     191                "value" => $meta['meta_value']
     192            );
     193        }
     194
     195        return $custom_fields;
     196    }
     197
     198    function set_custom_fields($post_id, $fields) {
     199        $post_id = (int) $post_id;
     200
     201        foreach ( (array) $fields as $meta ) {
     202            if ( isset($meta['id']) ) {
     203                $meta['id'] = (int) $meta['id'];
     204
     205                if ( isset($meta['key']) ) {
     206                    update_meta($meta['id'], $meta['key'], $meta['value']);
     207                }
     208                else {
     209                    delete_meta($meta['id']);
     210                }
     211            }
     212            else {
     213                $_POST['metakeyinput'] = $meta['key'];
     214                $_POST['metavalue'] = $meta['value'];
     215                add_meta($post_id);
     216            }
     217        }
     218    }
    219219
    220220    /**
     
    662662
    663663        set_current_user(0, $username);
    664         if( !current_user_can( 'edit_posts' ) ) 
     664        if( !current_user_can( 'edit_posts' ) )
    665665            return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts to this blog in order to view categories.' ) );
    666666
     
    680680
    681681    function wp_getCommentCount( $args ) {
    682         $this->escape($args); 
    683 
    684         $blog_id    = (int) $args[0]; 
    685         $username   = $args[1]; 
    686         $password   = $args[2]; 
    687         $post_id    = (int) $args[3]; 
    688 
    689         if( !$this->login_pass_ok( $username, $password ) ) { 
    690             return new IXR_Error( 403, __( 'Bad login/pass combination.' ) ); 
    691         } 
    692 
    693         set_current_user( 0, $username ); 
    694         if( !current_user_can( 'edit_posts' ) ) { 
    695             return new IXR_Error( 403, __( 'You are not allowed details about comments.' ) ); 
    696         } 
     682        $this->escape($args);
     683
     684        $blog_id    = (int) $args[0];
     685        $username   = $args[1];
     686        $password   = $args[2];
     687        $post_id    = (int) $args[3];
     688
     689        if( !$this->login_pass_ok( $username, $password ) ) {
     690            return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );
     691        }
     692
     693        set_current_user( 0, $username );
     694        if( !current_user_can( 'edit_posts' ) ) {
     695            return new IXR_Error( 403, __( 'You are not allowed details about comments.' ) );
     696        }
    697697
    698698        do_action('xmlrpc_call', 'wp.getCommentCount');
     
    792792
    793793        set_current_user( 0, $user_login );
    794         if( !current_user_can( 'edit_posts' ) ) 
     794        if( !current_user_can( 'edit_posts' ) )
    795795            return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this blog.' ) );
    796796
     
    825825
    826826        set_current_user( 0, $user_login );
    827         if( !current_user_can( 'edit_post', $post_ID ) ) 
     827        if( !current_user_can( 'edit_post', $post_ID ) )
    828828            return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) );
    829829
     
    986986        $content    = $args[4];
    987987        $publish    = $args[5];
    988        
     988
    989989        if (!$this->login_pass_ok($user_login, $user_pass)) {
    990990            return $this->error;
     
    997997        if ( !current_user_can($cap) )
    998998            return new IXR_Error(401, __('Sorry, you are not allowed to post on this blog.'));
    999        
     999
    10001000        $post_status = ($publish) ? 'publish' : 'draft';
    1001        
     1001
    10021002        $post_author = $user->ID;
    1003        
     1003
    10041004        $post_title = xmlrpc_getposttitle($content);
    10051005        $post_category = xmlrpc_getpostcategory($content);
    10061006        $post_content = xmlrpc_removepostdata($content);
    1007        
     1007
    10081008        $post_date = current_time('mysql');
    10091009        $post_date_gmt = current_time('mysql', 1);
    1010        
     1010
    10111011        $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status');
    1012        
     1012
    10131013        $post_ID = wp_insert_post($post_data);
    10141014        if ( is_wp_error( $post_ID ) )
     
    10291029
    10301030        $this->escape($args);
    1031        
     1031
    10321032        $post_ID     = (int) $args[1];
    10331033        $user_login  = $args[2];
     
    10351035        $content     = $args[4];
    10361036        $publish     = $args[5];
    1037        
     1037
    10381038        if (!$this->login_pass_ok($user_login, $user_pass)) {
    10391039            return $this->error;
     
    10431043
    10441044        $actual_post = wp_get_single_post($post_ID,ARRAY_A);
    1045        
     1045
    10461046        if (!$actual_post) {
    10471047            return new IXR_Error(404, __('Sorry, no such post.'));
    10481048        }
    1049        
     1049
    10501050        $this->escape($actual_post);
    1051        
     1051
    10521052        set_current_user(0, $user_login);
    10531053        if ( !current_user_can('edit_post', $post_ID) )
    10541054            return new IXR_Error(401, __('Sorry, you do not have the right to edit this post.'));
    1055        
     1055
    10561056        extract($actual_post, EXTR_SKIP);
    1057        
     1057
    10581058        if ( ('publish' == $post_status) && !current_user_can('publish_posts') )
    10591059            return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
    1060        
     1060
    10611061        $post_title = xmlrpc_getposttitle($content);
    10621062        $post_category = xmlrpc_getpostcategory($content);
    10631063        $post_content = xmlrpc_removepostdata($content);
    1064        
     1064
    10651065        $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt');
    1066        
     1066
    10671067        $result = wp_update_post($postdata);
    1068        
     1068
    10691069        if (!$result) {
    10701070            return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be edited.'));
    10711071        }
    10721072        $this->attach_uploads( $ID, $post_content );
    1073        
     1073
    10741074        return true;
    10751075    }
     
    10791079    function blogger_deletePost($args) {
    10801080        $this->escape($args);
    1081        
     1081
    10821082        $post_ID     = (int) $args[1];
    10831083        $user_login  = $args[2];
    10841084        $user_pass   = $args[3];
    10851085        $publish     = $args[4];
    1086        
     1086
    10871087        if (!$this->login_pass_ok($user_login, $user_pass)) {
    10881088            return $this->error;
     
    10921092
    10931093        $actual_post = wp_get_single_post($post_ID,ARRAY_A);
    1094        
     1094
    10951095        if (!$actual_post) {
    10961096            return new IXR_Error(404, __('Sorry, no such post.'));
    10971097        }
    1098        
     1098
    10991099        set_current_user(0, $user_login);
    11001100        if ( !current_user_can('edit_post', $post_ID) )
    11011101            return new IXR_Error(401, __('Sorry, you do not have the right to delete this post.'));
    1102        
     1102
    11031103        $result = wp_delete_post($post_ID);
    1104        
     1104
    11051105        if (!$result) {
    11061106            return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be deleted.'));
    11071107        }
    1108        
     1108
    11091109        return true;
    11101110    }
     
    11251125        $content_struct = $args[3];
    11261126        $publish     = $args[4];
    1127        
     1127
    11281128        if (!$this->login_pass_ok($user_login, $user_pass)) {
    11291129            return $this->error;
     
    12251225            }
    12261226        }
    1227        
     1227
    12281228        $post_excerpt = $content_struct['mt_excerpt'];
    12291229        $post_more = $content_struct['mt_text_more'];
     
    12991299            $post_content = $post_content . "\n<!--more-->\n" . $post_more;
    13001300        }
    1301        
     1301
    13021302        $to_ping = $content_struct['mt_tb_ping_urls'];
    13031303        if ( is_array($to_ping) )
     
    13211321        logIO('O', 'Post cats: ' . var_export($catnames,true));
    13221322        $post_category = array();
    1323        
     1323
    13241324        if (is_array($catnames)) {
    13251325            foreach ($catnames as $cat) {
     
    13301330        // We've got all the data -- post it:
    13311331        $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input');
    1332        
     1332
    13331333        $post_ID = wp_insert_post($postdata);
    13341334        if ( is_wp_error( $post_ID ) )
    13351335            return new IXR_Error(500, $post_ID->get_error_message());
    1336        
     1336
    13371337        if (!$post_ID) {
    13381338            return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.'));
    13391339        }
    13401340
    1341         if ( isset($content_struct['custom_fields']) ) { 
    1342             $this->set_custom_fields($post_ID, $content_struct['custom_fields']); 
    1343         } 
    1344        
     1341        if ( isset($content_struct['custom_fields']) ) {
     1342            $this->set_custom_fields($post_ID, $content_struct['custom_fields']);
     1343        }
     1344
    13451345        $this->attach_uploads( $post_ID, $post_content );
    1346        
     1346
    13471347        logIO('O', "Posted ! ID: $post_ID");
    1348        
     1348
    13491349        return strval($post_ID);
    13501350    }
     
    13741374        $content_struct = $args[3];
    13751375        $publish     = $args[4];
    1376        
     1376
    13771377        if (!$this->login_pass_ok($user_login, $user_pass)) {
    13781378            return $this->error;
     
    15241524        $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
    15251525        $catnames = $content_struct['categories'];
    1526        
     1526
    15271527        $post_category = array();
    1528        
     1528
    15291529        if (is_array($catnames)) {
    15301530            foreach ($catnames as $cat) {
     
    15321532            }
    15331533        }
    1534        
     1534
    15351535        $post_excerpt = $content_struct['mt_excerpt'];
    15361536        $post_more = $content_struct['mt_text_more'];
     
    15551555            }
    15561556        }
    1557        
     1557
    15581558        $tags_input = $content_struct['mt_keywords'];
    15591559
     
    15641564                return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
    15651565        }
    1566        
     1566
    15671567        if ($post_more) {
    15681568            $post_content = $post_content . "\n<!--more-->\n" . $post_more;
     
    15891589        // We've got all the data -- post it:
    15901590        $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input');
    1591        
     1591
    15921592        $result = wp_update_post($newpost);
    15931593        if (!$result) {
     
    15951595        }
    15961596
    1597         if ( isset($content_struct['custom_fields']) ) { 
    1598             $this->set_custom_fields($post_ID, $content_struct['custom_fields']); 
    1599         } 
     1597        if ( isset($content_struct['custom_fields']) ) {
     1598            $this->set_custom_fields($post_ID, $content_struct['custom_fields']);
     1599        }
    16001600
    16011601        $this->attach_uploads( $ID, $post_content );
    1602        
     1602
    16031603        logIO('O',"(MW) Edited ! ID: $post_ID");
    1604        
     1604
    16051605        return true;
    16061606    }
     
    16111611
    16121612        $this->escape($args);
    1613        
     1613
    16141614        $post_ID     = (int) $args[0];
    16151615        $user_login  = $args[1];
    16161616        $user_pass   = $args[2];
    1617        
     1617
    16181618        if (!$this->login_pass_ok($user_login, $user_pass)) {
    16191619            return $this->error;
     
    16271627
    16281628        $postdata = wp_get_single_post($post_ID, ARRAY_A);
    1629        
     1629
    16301630        if ($postdata['post_date'] != '') {
    16311631            $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']);
    16321632            $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']);
    1633        
     1633
    16341634            $categories = array();
    16351635            $catids = wp_get_post_categories($post_ID);
    16361636            foreach($catids as $catid)
    16371637                $categories[] = get_cat_name($catid);
    1638            
     1638
    16391639            $tagnames = array();
    16401640            $tags = wp_get_post_tags( $post_ID );
     
    16461646                $tagnames = '';
    16471647            }
    1648            
     1648
    16491649            $post = get_extended($postdata['post_content']);
    16501650            $link = post_permalink($postdata['ID']);
    1651            
     1651
    16521652            // Get the author info.
    16531653            $author = get_userdata($postdata['post_author']);
    1654            
     1654
    16551655            $allow_comments = ('open' == $postdata['comment_status']) ? 1 : 0;
    16561656            $allow_pings = ('open' == $postdata['ping_status']) ? 1 : 0;
     
    16601660                $postdata['post_status'] = 'publish';
    16611661            }
    1662            
     1662
    16631663            $resp = array(
    16641664                'dateCreated' => new IXR_Date($post_date),
     
    16851685                'custom_fields' => $this->get_custom_fields($post_ID)
    16861686            );
    1687            
     1687
    16881688            return $resp;
    16891689        } else {
     
    19371937
    19381938        foreach ($posts_list as $entry) {
    1939             if( !current_user_can( 'edit_post', $entry['ID'] ) ) 
     1939            if( !current_user_can( 'edit_post', $entry['ID'] ) )
    19401940                continue;
    19411941
Note: See TracChangeset for help on using the changeset viewer.