Make WordPress Core


Ignore:
Timestamp:
05/29/2015 08:16:22 PM (9 years ago)
Author:
wonderboymusic
Message:

Add missing doc blocks to wp-admin/includes/*.
Fix some egregious uses of tabbing.
Some functions can simply return apply_filters(...) instead of setting a variable that is immediately returned.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r32643 r32654  
    166166
    167167    $wpdb->insert( $wpdb->posts, array(
    168                                 'post_author' => $user_id,
    169                                 'post_date' => $now,
    170                                 'post_date_gmt' => $now_gmt,
    171                                 'post_content' => $first_post,
    172                                 'post_excerpt' => '',
    173                                 'post_title' => __('Hello world!'),
    174                                 /* translators: Default post slug */
    175                                 'post_name' => sanitize_title( _x('hello-world', 'Default post slug') ),
    176                                 'post_modified' => $now,
    177                                 'post_modified_gmt' => $now_gmt,
    178                                 'guid' => $first_post_guid,
    179                                 'comment_count' => 1,
    180                                 'to_ping' => '',
    181                                 'pinged' => '',
    182                                 'post_content_filtered' => ''
    183                                 ));
     168        'post_author' => $user_id,
     169        'post_date' => $now,
     170        'post_date_gmt' => $now_gmt,
     171        'post_content' => $first_post,
     172        'post_excerpt' => '',
     173        'post_title' => __('Hello world!'),
     174        /* translators: Default post slug */
     175        'post_name' => sanitize_title( _x('hello-world', 'Default post slug') ),
     176        'post_modified' => $now,
     177        'post_modified_gmt' => $now_gmt,
     178        'guid' => $first_post_guid,
     179        'comment_count' => 1,
     180        'to_ping' => '',
     181        'pinged' => '',
     182        'post_content_filtered' => ''
     183    ));
    184184    $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $cat_tt_id, 'object_id' => 1) );
    185185
     
    195195    }
    196196    $wpdb->insert( $wpdb->comments, array(
    197                                 'comment_post_ID' => 1,
    198                                 'comment_author' => $first_comment_author,
    199                                 'comment_author_email' => '',
    200                                 'comment_author_url' => $first_comment_url,
    201                                 'comment_date' => $now,
    202                                 'comment_date_gmt' => $now_gmt,
    203                                 'comment_content' => $first_comment
    204                                 ));
     197        'comment_post_ID' => 1,
     198        'comment_author' => $first_comment_author,
     199        'comment_author_email' => '',
     200        'comment_author_url' => $first_comment_url,
     201        'comment_date' => $now,
     202        'comment_date_gmt' => $now_gmt,
     203        'comment_content' => $first_comment
     204    ));
    205205
    206206    // First Page
     
    218218    $first_post_guid = get_option('home') . '/?page_id=2';
    219219    $wpdb->insert( $wpdb->posts, array(
    220                                 'post_author' => $user_id,
    221                                 'post_date' => $now,
    222                                 'post_date_gmt' => $now_gmt,
    223                                 'post_content' => $first_page,
    224                                 'post_excerpt' => '',
    225                                 'post_title' => __( 'Sample Page' ),
    226                                 /* translators: Default page slug */
    227                                 'post_name' => __( 'sample-page' ),
    228                                 'post_modified' => $now,
    229                                 'post_modified_gmt' => $now_gmt,
    230                                 'guid' => $first_post_guid,
    231                                 'post_type' => 'page',
    232                                 'to_ping' => '',
    233                                 'pinged' => '',
    234                                 'post_content_filtered' => ''
    235                                 ));
     220        'post_author' => $user_id,
     221        'post_date' => $now,
     222        'post_date_gmt' => $now_gmt,
     223        'post_content' => $first_page,
     224        'post_excerpt' => '',
     225        'post_title' => __( 'Sample Page' ),
     226        /* translators: Default page slug */
     227        'post_name' => __( 'sample-page' ),
     228        'post_modified' => $now,
     229        'post_modified_gmt' => $now_gmt,
     230        'guid' => $first_post_guid,
     231        'post_type' => 'page',
     232        'to_ping' => '',
     233        'pinged' => '',
     234        'post_content_filtered' => ''
     235    ));
    236236    $wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) );
    237237
     
    393393 * @global int  $wp_db_version
    394394 * @global wpdb $wpdb
    395  *
    396  * @return null If no update is necessary or site isn't completely installed, null.
    397395 */
    398396function wp_upgrade() {
     
    446444 * @global int $wp_current_db_version
    447445 * @global int $wp_db_version
    448  *
    449  * @return null If no update is necessary, null.
    450446 */
    451447function upgrade_all() {
     
    17481744 * @param string $table Database table name.
    17491745 * @param string $index Index name to drop.
    1750  * @return bool True, when finished.
     1746 * @return true True, when finished.
    17511747 */
    17521748function drop_index($table, $index) {
     
    17711767 * @param string $table Database table name.
    17721768 * @param string $index Database table index column.
    1773  * @return bool True, when done with execution.
     1769 * @return true True, when done with execution.
    17741770 */
    17751771function add_clean_index($table, $index) {
     
    17901786 * @param string $column_name The column name to add to the table.
    17911787 * @param string $create_ddl  The SQL statement used to add the column.
    1792  * @return True if already exists or on successful completion, false on error.
     1788 * @return bool True if already exists or on successful completion, false on error.
    17931789 */
    17941790function maybe_add_column($table_name, $column_name, $create_ddl) {
     
    22792275                // Don't copy anything.
    22802276                continue;
    2281                 }
     2277            }
    22822278        }
    22832279
     
    23322328 * @param string $theme_name The name of the theme.
    23332329 * @param string $template   The directory name of the theme.
    2334  * @return null|false
     2330 * @return false|void
    23352331 */
    23362332function make_site_theme_from_default($theme_name, $template) {
Note: See TracChangeset for help on using the changeset viewer.