Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (6 years ago)
Author:
pento
Message:

Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:

  • Multiline function calls must now put each parameter on a new line.
  • Auto-formatting files is now part of the grunt precommit script.
  • Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.

File:
1 edited

Legend:

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

    r43203 r43571  
    2020} else {
    2121
    22     $title = __('Tools');
     22    $title = __( 'Tools' );
    2323
    24     get_current_screen()->add_help_tab( array(
    25         'id'      => 'converter',
    26         'title'   => __('Categories and Tags Converter'),
    27         'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
    28         '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
    29     ) );
     24    get_current_screen()->add_help_tab(
     25        array(
     26            'id'      => 'converter',
     27            'title'   => __( 'Categories and Tags Converter' ),
     28            'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
     29            '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
     30        )
     31    );
    3032
    3133    get_current_screen()->set_help_sidebar(
    32         '<p><strong>' . __('For more information:') . '</strong></p>' .
    33         '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>') . '</p>' .
    34         '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
     34        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
     35        '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>' ) . '</p>' .
     36        '<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
    3537    );
    3638}
     
    5355
    5456    if ( current_user_can( 'import' ) ) :
    55     $cats = get_taxonomy('category');
    56     $tags = get_taxonomy('post_tag');
    57     if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>
     57        $cats = get_taxonomy( 'category' );
     58        $tags = get_taxonomy( 'post_tag' );
     59        if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) :
     60            ?>
    5861    <div class="card">
    59         <h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2>
    60         <p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p>
     62        <h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2>
     63        <p><?php printf( __( 'If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.' ), 'import.php' ); ?></p>
    6164    </div>
    62     <?php
     65            <?php
    6366    endif;
    6467    endif;
Note: See TracChangeset for help on using the changeset viewer.