Permalink
Browse files

Clean up PHPCS errors/warnings

  • Loading branch information...
Evan Herman
Evan Herman committed Jun 29, 2017
1 parent ea6ff5f commit def122dfbd024f76c3f0891ebd892327e9acea08
View
@@ -576,7 +576,11 @@ function primer_wc_cart_menu( $items, $args ) {
</li>',
implode( ' ', array_map( 'esc_attr', $classes ) ),
$woocommerce->cart->get_cart_total(),
esc_html( sprintf( _n( '%d item', '%d items', $woocommerce->cart->get_cart_contents_count(), 'primer' ), $woocommerce->cart->get_cart_contents_count() ) ),
esc_html( sprintf(
/* translators: WooCommerce shopping cart item count. */
_n( '%d item', '%d items', $woocommerce->cart->get_cart_contents_count(), 'primer' ),
$woocommerce->cart->get_cart_contents_count()
) ),
$woocommerce->cart->get_cart_contents_count() ? '<a class="expand" href="#"></a>' : '',
$sub_menu
);
@@ -675,7 +679,7 @@ function primer_wc_promoted_products( $per_page = 4, $columns = 4, $recent_fallb
}
}
} // End if().
if ( ! function_exists( 'primer_wc_best_selling_products' ) ) {
@@ -715,7 +719,7 @@ function primer_wc_best_selling_products( $per_page = 4, $columns = 4 ) {
}
}
} // End if().
/**
* Prevent WooCommerce product image from loading as the header image
View
@@ -52,6 +52,7 @@ function primer_get_wp_upgrade_message() {
*/
return (string) apply_filters( 'primer_required_wp_version_message',
sprintf(
/* translators: 1. Primer minimum WordPress version. 2. Current WordPress version. */
esc_html__( 'Primer requires at least WordPress version %1$s. You are running version %2$s. Please upgrade and try again.', 'primer' ),
PRIMER_MIN_WP_VERSION,
get_bloginfo( 'version' )
@@ -95,7 +96,7 @@ function primer_customize() {
*/
function primer_preview() {
if ( isset( $_GET['preview'] ) ) { // input var ok.
if ( isset( $_GET['preview'] ) ) { // @codingStandardsIgnoreLine
wp_die( esc_html( primer_get_wp_upgrade_message() ) );
@@ -661,7 +661,7 @@ public function __construct() {
$color_schemes = primer_array_replace_recursive( $color_schemes, $overrides );
}
} // End if().
/**
* Filter the available color schemes.
View
@@ -18,6 +18,7 @@
function primer_get_the_page_title() {
$title = '';
$post = get_queried_object();
switch ( true ) {
@@ -64,7 +65,7 @@ function primer_get_the_page_title() {
break;
case ( ( $post = get_queried_object() ) && ! is_post_type_hierarchical( get_post_type( $post ) ) ) :
case ( ! is_post_type_hierarchical( get_post_type( $post ) ) ) :
$show_on_front = get_option( 'show_on_front' );
$page_for_posts = get_option( 'page_for_posts' );
@@ -318,10 +319,12 @@ function primer_get_hero_image() {
*/
$size = (string) apply_filters( 'primer_hero_image_size', 'primer-hero' );
$post = get_queried_object();
/**
* Featured Image (if enabled)
*/
if ( primer_use_featured_hero_image() && ( $post = get_queried_object() ) && has_post_thumbnail( $post ) ) {
if ( primer_use_featured_hero_image() && has_post_thumbnail( $post ) ) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post ), $size );
@@ -490,7 +493,9 @@ function primer_has_footer_menu() {
*/
function primer_has_active_categories() {
if ( WP_DEBUG || false === ( $has_active_categories = get_transient( 'primer_has_active_categories' ) ) ) {
$has_active_categories = get_transient( 'primer_has_active_categories' );
if ( WP_DEBUG || false === $has_active_categories ) {
$categories = get_categories(
array(
@@ -582,9 +587,10 @@ function primer_array_replace_recursive( array $array1, array $array2 ) {
}
$total = func_num_args();
$result = array();
for ( $i = 0, $total = func_num_args(); $i < $total; $i++ ) {
for ( $i = 0; $i < $total; $i++ ) {
$_array = func_get_arg( $i );
View
@@ -249,7 +249,9 @@ public function print_scripts() {
*/
protected function get_current_theme_name() {
if ( $current_theme = get_option( 'current_theme' ) ) {
$current_theme = get_option( 'current_theme' );
if ( $current_theme ) {
return $current_theme;
View
@@ -437,13 +437,13 @@ function primer_breadcrumbs() {
echo '404';
}
} // End if().
} else {
bloginfo( 'name' );
}
} // End if().
echo '</div>';
View
@@ -4,6 +4,7 @@
<rule ref="WordPress">
<exclude name="Squiz.Commenting.FileComment"></exclude>
<exclude name="WordPress.Files.FileName.InvalidClassFileName"></exclude>
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing"></exclude>
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"></exclude>
</rule>
@@ -6,7 +6,9 @@
* @since 1.0.0
*/
if ( $sidebars = primer_get_active_footer_sidebars() ) :
$sidebars = primer_get_active_footer_sidebars();
if ( $sidebars ) :
?>
<div class="footer-widget-area columns-<?php echo count( $sidebars ); ?>">

0 comments on commit def122d

Please sign in to comment.