Make WordPress Core

Changeset 31220


Ignore:
Timestamp:
01/16/2015 10:50:20 PM (10 years ago)
Author:
wonderboymusic
Message:

Fix some internal types that are passed to functions to avoid changing the acceptable types passed as arguments to those functions:

  • In WP_Importer->is_user_over_quota(), the default value for the first argument for upload_is_user_over_quota() is true. Don't bother passing 1.
  • When calling submit_button() with no $name, pass empty string instead of false.
  • The default value for the 2nd argument to get_edit_post_link() is 'display'. Because PHP is PHP, passing true is the same as passing 'display' or nothing. Don't bother passing true.
  • In WP_User_Meta_Session_Tokens::drop_sessions(), pass 0 instead of false to delete_metadata() as the value for $object_id, which expects an int.

See #30799.

Location:
trunk/src
Files:
5 edited

Legend:

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

    r31125 r31220  
    210210    public function is_user_over_quota() {
    211211        if ( function_exists( 'upload_is_user_over_quota' ) ) {
    212             if ( upload_is_user_over_quota( 1 ) ) {
     212            if ( upload_is_user_over_quota() ) {
    213213                echo "Sorry, you have used your upload quota.\n";
    214214                return true;
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r31211 r31220  
    338338    <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
    339339    <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
    340     <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
     340    <?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
    341341</p>
    342342<?php
     
    446446        echo "</select>\n";
    447447
    448         submit_button( __( 'Apply' ), 'action', false, false, array( 'id' => "doaction$two" ) );
     448        submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
    449449        echo "\n";
    450450    }
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r31181 r31220  
    316316                } else {
    317317?>
    318                 <a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ); ?>">
     318                <a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ); ?>">
    319319                    <?php echo $thumb; ?>
    320320                </a>
     
    333333                echo $att_title;
    334334            } else { ?>
    335             <a href="<?php echo get_edit_post_link( $post->ID, true ); ?>"
     335            <a href="<?php echo get_edit_post_link( $post->ID ); ?>"
    336336                title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $att_title ) ); ?>">
    337337                <?php echo $att_title; ?></a>
     
    502502        if ( $this->detached ) {
    503503            if ( current_user_can( 'edit_post', $post->ID ) )
    504                 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>';
     504                $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '">' . __( 'Edit' ) . '</a>';
    505505            if ( current_user_can( 'delete_post', $post->ID ) )
    506506                if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
     
    516516        else {
    517517            if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash )
    518                 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>';
     518                $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '">' . __( 'Edit' ) . '</a>';
    519519            if ( current_user_can( 'delete_post', $post->ID ) ) {
    520520                if ( $this->is_trash )
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r31200 r31220  
    696696                $actions = array();
    697697                if ( $can_edit_post && 'trash' != $post->post_status ) {
    698                     $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>';
     698                    $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>';
    699699                    $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr__( 'Edit this item inline' ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
    700700                }
  • trunk/src/wp-includes/session.php

    r30333 r31220  
    435435     */
    436436    public static function drop_sessions() {
    437         delete_metadata( 'user', false, 'session_tokens', false, true );
     437        delete_metadata( 'user', 0, 'session_tokens', false, true );
    438438    }
    439439}
Note: See TracChangeset for help on using the changeset viewer.