Skip to content

Commit

Permalink
PHPCS Warnings and Error Fixes (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
mharis authored and gregrickaby committed Sep 19, 2018
1 parent 0a7bf25 commit bc97fcb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function _s_widgets_init() {

// Define sidebars.
$sidebars = array(
'sidebar-1' => esc_html__( 'Sidebar 1', '_s' ),
'sidebar-1' => esc_html__( 'Sidebar 1', '_s' ),
// 'sidebar-2' => esc_html__( 'Sidebar 2', '_s' ),
// 'sidebar-3' => esc_html__( 'Sidebar 3', '_s' ),
);
Expand Down
6 changes: 3 additions & 3 deletions inc/acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ function _s_has_block_expired( $args = array() ) {
$args = wp_parse_args( $args, $defaults );

// Get (Unix) times and convert to integer.
$now = (int) date( 'U' );
$now = (int) date( 'U' );
$start = (int) $args['start_date'];
$end = (int) $args['end_date'];
$end = (int) $args['end_date'];

// No dates? Cool, they're optional.
if ( empty( $start ) || empty( $end ) ) {
Expand All @@ -194,7 +194,7 @@ function _s_has_block_expired( $args = array() ) {
function _s_acf_admin_scripts() {

// If a SCRIPT_DEBUG constant is defined or there is a $_GET param of 'script_debug', load unminified files.
$suffix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) || isset( $_GET['script_debug'] ) ? '' : '.min';
$suffix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) || isset( $_GET['script_debug'] ) ? '' : '.min'; // phpcs:ignore

// Version assets using this value. Bump it to bust old, cached files.
$version = '1.0.0';
Expand Down
17 changes: 10 additions & 7 deletions inc/scaffolding.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function _s_scaffolding_allowed_html() {

// Add additional HTML tags to the wp_kses() allowed html filter.
$allowed_tags = array_merge( wp_kses_allowed_html( 'post' ), array(
'svg' => array(
'svg' => array(
'aria-hidden' => true,
'class' => true,
'id' => true,
Expand All @@ -117,25 +117,25 @@ function _s_scaffolding_allowed_html() {
'use' => true,
'path' => true,
),
'use' => array(
'use' => array(
'xlink:href' => true,
),
'title' => array(
'title' => array(
'id' => true,
),
'desc' => array(
'desc' => array(
'id' => true,
),
'select' => array(
'class' => true,
'class' => true,
),
'option' => array(
'option' => true,
'value' => true,
'selected' => true,
'disabled' => true,
),
'input' => array(
'input' => array(
'type' => true,
'name' => true,
'value' => true,
Expand Down Expand Up @@ -217,7 +217,10 @@ function _s_display_global_scaffolding_section( $args = array() ) {
<p><strong><?php echo esc_html( $font_var ); ?>:</strong> <span style="font-family: <?php echo esc_attr( $family ); ?>"><?php echo esc_html( $family ); ?></span></p>
<?php endforeach; ?>
</div>
<?php break; ?>
<?php
break;
default:
?>
<?php endswitch; ?>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions inc/scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function _s_scripts() {
/**
* If WP is in script debug, or we pass ?script_debug in a URL - set debug to true.
*/
$debug = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) || ( isset( $_GET['script_debug'] ) ) ? true : false;
$debug = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) || ( isset( $_GET['script_debug'] ) ) ? true : false; // phpcs:ignore

/**
* If we are debugging the site, use a unique version every page load so as to ensure no cache issues.
Expand Down Expand Up @@ -105,7 +105,7 @@ function _s_customizer_scripts() {
/**
* If WP is in script debug, or we pass ?script_debug in a URL - set debug to true.
*/
$debug = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) || ( isset( $_GET['script_debug'] ) ) ? true : false;
$debug = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) || ( isset( $_GET['script_debug'] ) ) ? true : false; // phpcs:ignore

/**
* If we are debugging the site, use a unique version every page load so as to ensure no cache issues.
Expand Down
6 changes: 3 additions & 3 deletions template-parts/scaffolding/scaffolding-globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

// Theme fonts.
_s_display_global_scaffolding_section( array( // WPCS: XSS OK.
'global_type' => 'fonts',
'title' => 'Fonts',
'arguments' => array(
'global_type' => 'fonts',
'title' => 'Fonts',
'arguments' => array(
'Sans' => '"Open Sans", sans-serif',
'Serif' => 'Roboto, Georgia, Times, "Times New Roman", serif',
'Code' => 'Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace',
Expand Down

0 comments on commit bc97fcb

Please sign in to comment.