Make WordPress Core

Changeset 19687


Ignore:
Timestamp:
01/05/2012 08:50:54 PM (13 years ago)
Author:
ryan
Message:

User lowercase true, false, null instead of uppercase. Props c3mdigital, mfields. fixes #16302

Location:
trunk
Files:
28 edited

Legend:

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

    r19684 r19687  
    1313 */
    1414if ( ! defined('WP_ADMIN') )
    15     define('WP_ADMIN', TRUE);
     15    define('WP_ADMIN', true);
    1616
    1717if ( ! defined('WP_NETWORK_ADMIN') )
    18     define('WP_NETWORK_ADMIN', FALSE);
     18    define('WP_NETWORK_ADMIN', false);
    1919
    2020if ( ! defined('WP_USER_ADMIN') )
    21     define('WP_USER_ADMIN', FALSE);
     21    define('WP_USER_ADMIN', false);
    2222
    2323if ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) {
    24     define('WP_BLOG_ADMIN', TRUE);
     24    define('WP_BLOG_ADMIN', true);
    2525}
    2626
  • trunk/wp-admin/includes/image.php

    r19593 r19687  
    105105
    106106        foreach ( get_intermediate_image_sizes() as $s ) {
    107             $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE );
     107            $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => false );
    108108            if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
    109109                $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes
  • trunk/wp-admin/includes/plugin.php

    r19684 r19687  
    864864 * @return string The resulting page's hook_suffix
    865865 */
    866 function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = NULL ) {
     866function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null ) {
    867867    global $menu, $admin_page_hooks, $_registered_pages, $_parent_pages;
    868868
  • trunk/wp-admin/includes/post.php

    r19596 r19687  
    11431143 * @return string html
    11441144 */
    1145 function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
     1145function _wp_post_thumbnail_html( $thumbnail_id = null ) {
    11461146    global $content_width, $_wp_additional_image_sizes, $post_ID;
    11471147    $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="' . esc_url( get_upload_iframe_src('image') ) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
  • trunk/wp-admin/includes/template.php

    r19684 r19687  
    11991199 * @return array Array of settings errors
    12001200 */
    1201 function get_settings_errors( $setting = '', $sanitize = FALSE ) {
     1201function get_settings_errors( $setting = '', $sanitize = false ) {
    12021202    global $wp_settings_errors;
    12031203
     
    12511251 * @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
    12521252 */
    1253 function settings_errors( $setting = '', $sanitize = FALSE, $hide_on_update = FALSE ) {
     1253function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
    12541254
    12551255    if ($hide_on_update AND $_GET['settings-updated']) return;
     
    15881588 *                     string such as 'tabindex="1"', though the array format is typically cleaner.
    15891589 */
    1590 function submit_button( $text = NULL, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = NULL ) {
     1590function submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) {
    15911591    echo get_submit_button( $text, $type, $name, $wrap, $other_attributes );
    15921592}
     
    16091609 *                     string such as 'tabindex="1"', though the array format is typically cleaner.
    16101610 */
    1611 function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = NULL ) {
     1611function get_submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) {
    16121612    switch ( $type ) :
    16131613        case 'primary' :
     
    16211621            $class = $type; // Custom cases can just pass in the classes they want to be used
    16221622    endswitch;
    1623     $text = ( NULL == $text ) ? __( 'Save Changes' ) : $text;
     1623    $text = ( null == $text ) ? __( 'Save Changes' ) : $text;
    16241624
    16251625    // Default the id attribute to $name unless an id was specifically provided in $other_attributes
  • trunk/wp-admin/includes/upgrade.php

    r19596 r19687  
    14051405
    14061406    @ $kellogs = unserialize($option);
    1407     if ($kellogs !== FALSE)
     1407    if ($kellogs !== false)
    14081408        return $kellogs;
    14091409    else
  • trunk/wp-admin/network/admin.php

    r17668 r19687  
    88 */
    99
    10 define( 'WP_NETWORK_ADMIN', TRUE );
     10define( 'WP_NETWORK_ADMIN', true );
    1111
    1212/** Load WordPress Administration Bootstrap */
  • trunk/wp-admin/theme-editor.php

    r19528 r19687  
    8787        //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable
    8888        $f = fopen($file, 'w+');
    89         if ($f !== FALSE) {
     89        if ($f !== false) {
    9090            fwrite($f, $newcontent);
    9191            fclose($f);
  • trunk/wp-admin/user/admin.php

    r17668 r19687  
    88 */
    99
    10 define('WP_USER_ADMIN', TRUE);
     10define('WP_USER_ADMIN', true);
    1111
    1212require_once( dirname(dirname(__FILE__)) . '/admin.php');
  • trunk/wp-app.php

    r19593 r19687  
    616616        $ext = preg_replace( '|.*/([a-z0-9]+)|', '$1', $_SERVER['CONTENT_TYPE'] );
    617617        $slug = sanitize_file_name( "$slug.$ext" );
    618         $file = wp_upload_bits( $slug, NULL, $bits);
     618        $file = wp_upload_bits( $slug, null, $bits);
    619619
    620620        log_app('wp_upload_bits returns:',print_r($file,true));
     
    10741074        log_app('function',"total_count(# $wp_query->max_num_pages #)");
    10751075        $last_page = $wp_query->max_num_pages;
    1076         $next_page = (($page + 1) > $last_page) ? NULL : $page + 1;
    1077         $prev_page = ($page - 1) < 1 ? NULL : $page - 1;
    1078         $last_page = ((int)$last_page == 1 || (int)$last_page == 0) ? NULL : (int) $last_page;
    1079         $self_page = $page > 1 ? $page : NULL;
     1076        $next_page = (($page + 1) > $last_page) ? null : $page + 1;
     1077        $prev_page = ($page - 1) < 1 ? null : $page - 1;
     1078        $last_page = ((int)$last_page == 1 || (int)$last_page == 0) ? null : (int) $last_page;
     1079        $self_page = $page > 1 ? $page : null;
    10801080?><feed xmlns="<?php echo $this->ATOM_NS ?>" xmlns:app="<?php echo $this->ATOMPUB_NS ?>" xml:lang="<?php echo get_option('rss_language'); ?>" <?php do_action('app_ns'); ?> >
    10811081<id><?php $this->the_entries_url() ?></id>
     
    15281528                $post = wp_get_single_post($this->params[1]);
    15291529                $wp_last_modified = get_post_modified_time('D, d M Y H:i:s', true);
    1530                 $post = NULL;
     1530                $post = null;
    15311531                break;
    15321532            case $this->ENTRIES_PATH:
  • trunk/wp-includes/cache.php

    r19593 r19687  
    497497            $group = 'default';
    498498
    499         if ( NULL === $data )
     499        if ( null === $data )
    500500            $data = '';
    501501
  • trunk/wp-includes/canonical.php

    r19364 r19687  
    396396    }
    397397
    398     // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning FALSE
     398    // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning false
    399399    $redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url);
    400400
  • trunk/wp-includes/class-http.php

    r19684 r19687  
    14911491     *
    14921492     * @param string $url URL you intend to send this cookie to
    1493      * @return boolean TRUE if allowed, FALSE otherwise.
     1493     * @return boolean true if allowed, false otherwise.
    14941494     */
    14951495    function test( $url ) {
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r19684 r19687  
    30793079        }
    30803080
    3081         $upload = wp_upload_bits($name, NULL, $bits);
     3081        $upload = wp_upload_bits($name, null, $bits);
    30823082        if ( ! empty($upload['error']) ) {
    30833083            $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);
  • trunk/wp-includes/comment-template.php

    r19679 r19687  
    770770 * @return bool True if the comments are open
    771771 */
    772 function comments_open( $post_id=NULL ) {
     772function comments_open( $post_id = null ) {
    773773
    774774    $_post = get_post($post_id);
     
    787787 * @return bool True if pings are accepted
    788788 */
    789 function pings_open( $post_id = NULL ) {
     789function pings_open( $post_id = null ) {
    790790
    791791    $_post = get_post($post_id);
     
    900900    }
    901901
    902     $overridden_cpage = FALSE;
     902    $overridden_cpage = false;
    903903    if ( '' == get_query_var('cpage') && get_option('page_comments') ) {
    904904        set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 );
    905         $overridden_cpage = TRUE;
     905        $overridden_cpage = true;
    906906    }
    907907
     
    11921192 * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment.
    11931193 */
    1194 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) {
     1194function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) {
    11951195    global $comment;
    11961196
  • trunk/wp-includes/comment.php

    r19684 r19687  
    11351135    $approved = $comment->comment_approved;
    11361136
    1137     if ( $approved == NULL )
     1137    if ( $approved == null )
    11381138        return false;
    11391139    elseif ( $approved == '1' )
  • trunk/wp-includes/functions.php

    r19685 r19687  
    674674        if ( !empty($key) )
    675675            $k = $key . '%5B' . $k . '%5D';
    676         if ( $v === NULL )
     676        if ( $v === null )
    677677            continue;
    678678        elseif ( $v === FALSE )
     
    687687    }
    688688
    689     if ( NULL === $sep )
     689    if ( null === $sep )
    690690        $sep = ini_get('arg_separator.output');
    691691
  • trunk/wp-includes/functions.wp-scripts.php

    r19573 r19687  
    4646 * @param string $src Script url
    4747 * @param array $deps (optional) Array of script names on which this script depends
    48  * @param string|bool $ver (optional) Script version (used for cache busting), set to NULL to disable
     48 * @param string|bool $ver (optional) Script version (used for cache busting), set to null to disable
    4949 * @param bool $in_footer (optional) Whether to enqueue the script before </head> or before </body>
    5050 * @return null
  • trunk/wp-includes/functions.wp-styles.php

    r19673 r19687  
    7575 * @param array $deps Array of handles of any stylesheet that this stylesheet depends on.
    7676 *  (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies.
    77  * @param string|bool $ver String specifying the stylesheet version number. Set to NULL to disable.
     77 * @param string|bool $ver String specifying the stylesheet version number. Set to null to disable.
    7878 *  Used to ensure that the correct version is sent to the client regardless of caching.
    7979 * @param string $media The media for which this stylesheet has been defined.
  • trunk/wp-includes/general-template.php

    r19684 r19687  
    20662066 * 'wp_print_styles' action has *not* yet been called, the CSS file will be
    20672067 * enqueued. If the wp_print_styles action *has* been called, the CSS link will
    2068  * be printed. Printing may be forced by passing TRUE as the $force_echo
     2068 * be printed. Printing may be forced by passing true as the $force_echo
    20692069 * (second) parameter.
    20702070 *
  • trunk/wp-includes/kses.php

    r19593 r19687  
    764764                    $working = 1;
    765765                    $mode = 0;
    766                     if(FALSE === array_key_exists($attrname, $attrarr)) {
     766                    if(false === array_key_exists($attrname, $attrarr)) {
    767767                        $attrarr[$attrname] = array ('name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y');
    768768                    }
     
    781781                        $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
    782782
    783                     if(FALSE === array_key_exists($attrname, $attrarr)) {
     783                    if(false === array_key_exists($attrname, $attrarr)) {
    784784                        $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n');
    785785                    }
     
    797797                        $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
    798798
    799                     if(FALSE === array_key_exists($attrname, $attrarr)) {
     799                    if(false === array_key_exists($attrname, $attrarr)) {
    800800                        $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname='$thisval'", 'vless' => 'n');
    801801                    }
     
    813813                        $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
    814814
    815                     if(FALSE === array_key_exists($attrname, $attrarr)) {
     815                    if(false === array_key_exists($attrname, $attrarr)) {
    816816                        $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n');
    817817                    }
     
    832832    } # while
    833833
    834     if ($mode == 1 && FALSE === array_key_exists($attrname, $attrarr))
     834    if ($mode == 1 && false === array_key_exists($attrname, $attrarr))
    835835        # special case, for when the attribute list ends with a valueless
    836836        # attribute like "selected"
     
    939939
    940940/**
    941  * Removes any NULL characters in $string.
     941 * Removes any null characters in $string.
    942942 *
    943943 * @since 1.0.0
  • trunk/wp-includes/link-template.php

    r19684 r19687  
    23642364
    23652365    if ( empty( $title ) )
    2366         $title = the_title_attribute( array( 'echo' => FALSE ) );
     2366        $title = the_title_attribute( array( 'echo' => false ) );
    23672367
    23682368    $shortlink = wp_get_shortlink( $post->ID );
  • trunk/wp-includes/pluggable.php

    r19616 r19687  
    14191419        require_once( ABSPATH . 'wp-includes/class-phpass.php');
    14201420        // By default, use the portable hash from phpass
    1421         $wp_hasher = new PasswordHash(8, TRUE);
     1421        $wp_hasher = new PasswordHash(8, true);
    14221422    }
    14231423
     
    14671467        require_once( ABSPATH . 'wp-includes/class-phpass.php');
    14681468        // By default, use the portable hash from phpass
    1469         $wp_hasher = new PasswordHash(8, TRUE);
     1469        $wp_hasher = new PasswordHash(8, true);
    14701470    }
    14711471
  • trunk/wp-includes/query.php

    r19684 r19687  
    29292929            return $this->queried_object;
    29302930
    2931         $this->queried_object = NULL;
     2931        $this->queried_object = null;
    29322932        $this->queried_object_id = 0;
    29332933
  • trunk/wp-includes/shortcodes.php

    r18952 r19687  
    236236    } else {
    237237        // self-closing tag
    238         return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, NULL,  $tag ) . $m[6];
     238        return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, null,  $tag ) . $m[6];
    239239    }
    240240}
  • trunk/wp-includes/theme.php

    r19682 r19687  
    12801280 * Does not check the default theme, which is the fallback and should always exist.
    12811281 * Will switch theme to the fallback theme if current theme does not validate.
    1282  * You can use the 'validate_current_theme' filter to return FALSE to
     1282 * You can use the 'validate_current_theme' filter to return false to
    12831283 * disable this functionality.
    12841284 *
  • trunk/wp-includes/user.php

    r19684 r19687  
    154154    global $wpdb;
    155155
    156     $where = get_posts_by_author_sql('post', TRUE, $userid);
     156    $where = get_posts_by_author_sql('post', true, $userid);
    157157
    158158    $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" );
     
    854854        $select_count = array();
    855855        foreach ( $avail_roles as $this_role => $name ) {
    856             $select_count[] = "COUNT(NULLIF(`meta_value` LIKE '%" . like_escape($this_role) . "%', FALSE))";
     856            $select_count[] = "COUNT(NULLIF(`meta_value` LIKE '%" . like_escape($this_role) . "%', false))";
    857857        }
    858858        $select_count = implode(', ', $select_count);
  • trunk/wp-login.php

    r19593 r19687  
    604604
    605605    // Some parts of this script use the main login form to display a message
    606     if      ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )
     606    if      ( isset($_GET['loggedout']) && true == $_GET['loggedout'] )
    607607        $errors->add('loggedout', __('You are now logged out.'), 'message');
    608608    elseif  ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
Note: See TracChangeset for help on using the changeset viewer.