WordPress.org

Make WordPress Core

Ticket #43764: 43764.2.patch

File 43764.2.patch, 2.8 KB (added by marcomartins, 3 years ago)

Inline phpcs:ignore moved to its own line or replaced with phpcs:disable.

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

    From 9726aaba5d706988c52eaaf2c1e40a42bfbc9e23 Mon Sep 17 00:00:00 2001
    From: Marco Martins <marcomartins@fimdalinha.com>
    Date: Fri, 13 Apr 2018 17:33:32 +0300
    Subject: [PATCH] Fix CS violations for admin-header.php
    
    ---
     src/wp-admin/admin-header.php | 12 ++++++++++--
     1 file changed, 10 insertions(+), 2 deletions(-)
    
    diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php
    index 5322e2bb65..9cb7c85943 100644
    a b  
    66 * @subpackage Administration
    77 */
    88
    9 @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
     9// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
     10 @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
    1011if ( ! defined( 'WP_ADMIN' ) ) {
    1112        require_once( dirname( __FILE__ ) . '/admin.php' );
    1213}
    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:ignore 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}