Make WordPress Core

Ticket #43764: 43764.3.patch

File 43764.3.patch, 2.7 KB (added by marcomartins, 7 years ago)

Fixes WordPress.WhiteSpace.PrecisionAlignment.Found and a faulty phpcs:ignore

  • src/wp-admin/admin-header.php

    From 0311bf4f50e53c5d5a43d0ab68652977abea9a23 Mon Sep 17 00:00:00 2001
    From: Marco Martins <marcomartins@fimdalinha.com>
    Date: Fri, 13 Apr 2018 18:04:50 +0300
    Subject: [PATCH] Fix CS violations for admin-header.php
    
    ---
     src/wp-admin/admin-header.php | 10 +++++++++-
     1 file changed, 9 insertions(+), 1 deletion(-)
    
    diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php
    index 5322e2bb65..5386eb9fdf 100644
    a b  
    66 * @subpackage Administration
    77 */
    88
     9// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
    910@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
    1011if ( ! defined( 'WP_ADMIN' ) ) {
    1112        require_once( dirname( __FILE__ ) . '/admin.php' );
    if ( empty( $current_screen ) ) { 
    3233}
    3334
    3435get_admin_page_title();
     36// phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited -- allow existing globals
    3537$title = esc_html( strip_tags( $title ) );
    3638
    3739if ( is_network_admin() ) {
    var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', 
    98100 */
    99101do_action( 'admin_enqueue_scripts', $hook_suffix );
    100102
     103// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores -- allow for dash for dynamic hooks
    101104/**
    102105 * Fires when styles are printed for a specific admin page based on $hook_suffix.
    103106 *
    104107 * @since 2.6.0
    105108 */
    106109do_action( "admin_print_styles-{$hook_suffix}" );
     110// phpcs:enable
    107111
    108112/**
    109113 * Fires when styles are printed for all admin pages.
    do_action( "admin_print_styles-{$hook_suffix}" ); 
    112116 */
    113117do_action( 'admin_print_styles' );
    114118
     119// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores -- allow for dash for dynamic hooks
    115120/**
    116121 * Fires when scripts are printed for a specific admin page based on $hook_suffix.
    117122 *
    118123 * @since 2.1.0
    119124 */
    120125do_action( "admin_print_scripts-{$hook_suffix}" );
     126//phpcs:enable
    121127
    122128/**
    123129 * Fires when scripts are printed for all admin pages.
    do_action( "admin_print_scripts-{$hook_suffix}" ); 
    126132 */
    127133do_action( 'admin_print_scripts' );
    128134
     135// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores -- allow for dash for dynamic hooks
    129136/**
    130137 * Fires in head section for a specific admin page.
    131138 *
    do_action( 'admin_print_scripts' ); 
    135142 * @since 2.1.0
    136143 */
    137144do_action( "admin_head-{$hook_suffix}" );
     145// phpcs:enable
    138146
    139147/**
    140148 * Fires in head section for all admin pages.
    if ( is_network_admin() ) { 
    274282 */
    275283do_action( 'all_admin_notices' );
    276284
    277 if ( $parent_file == 'options-general.php' ) {
     285if ( 'options-general.php' === $parent_file ) {
    278286        require( ABSPATH . 'wp-admin/options-head.php' );
    279287}