Fix strict arrays

This commit is contained in:
Robin Cornett
2015-12-30 15:53:19 -05:00
parent 2673641640
commit 8560bf4689
5 changed files with 12 additions and 13 deletions
@@ -159,7 +159,7 @@ class Display_Featured_Image_Genesis_Admin {
*/
public function featured_image_column_width() {
$screen = get_current_screen();
if ( in_array( $screen->base, array( 'edit', 'edit-tags', 'users' ) ) ) { ?>
if ( in_array( $screen->base, array( 'edit', 'edit-tags', 'users' ), true ) ) { ?>
<style type="text/css">
.column-featured_image { width: 105px; }
.column-featured_image img { margin: 0 auto; display: block; height: auto; width: auto; max-width: 60px; max-height: 80px; }
@@ -16,7 +16,7 @@ class Display_Featured_Image_Genesis_Common {
public $version = '2.4.1';
/**
* set and retreive variables for the featured image.
* set and retrieve variables for the featured image.
* @return $item
*
* @since 1.1.0
@@ -36,13 +36,12 @@ class Display_Featured_Image_Genesis_Common {
/**
* create a filter for user to optionally force post types to use the large image instead of backstretch
* @var filter
*
* @since 2.0.0
*/
$use_large_image = apply_filters( 'display_featured_image_genesis_use_large_image', array() );
$image_size = 'displayfeaturedimage_backstretch';
if ( in_array( get_post_type(), $use_large_image ) ) {
if ( in_array( get_post_type(), $use_large_image, true ) ) {
$image_size = 'large';
}
@@ -110,7 +109,7 @@ class Display_Featured_Image_Genesis_Common {
if ( ! empty( $fallback ) ) {
$image_id = $fallback_id;
if ( in_array( get_post_type(), $use_fallback ) ) {
if ( in_array( get_post_type(), $use_fallback, true ) ) {
return (int) $image_id;
}
}
@@ -135,7 +134,7 @@ class Display_Featured_Image_Genesis_Common {
* @since 2.2.1
*/
$use_cpt = apply_filters( 'displayfeaturedimagegenesis_use_post_type_image', array() );
if ( in_array( get_post_type(), $use_cpt ) ) {
if ( in_array( get_post_type(), $use_cpt, true ) ) {
return (int) $image_id;
}
}
@@ -164,7 +163,7 @@ class Display_Featured_Image_Genesis_Common {
*/
$use_tax_image = apply_filters( 'display_featured_image_genesis_use_taxonomy', array() );
if ( in_array( get_post_type(), $use_tax_image ) ) {
if ( in_array( get_post_type(), $use_tax_image, true ) ) {
return (int) $image_id;
}
}
@@ -236,7 +236,7 @@ class Display_Featured_Image_Genesis_Helper {
$is_valid_types = (array) apply_filters( 'displayfeaturedimage_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif' ) );
return ( $file_ext && in_array( $file_ext, $is_valid_types ) );
return ( $file_ext && in_array( $file_ext, $is_valid_types, true ) );
}
/**
@@ -27,7 +27,7 @@ class Display_Featured_Image_Genesis_Output {
$post_types = array( 'attachment', 'revision', 'nav_menu_item' );
$skipped_types = apply_filters( 'display_featured_image_genesis_skipped_posttypes', $post_types );
if ( is_admin() || ( in_array( get_post_type(), $skipped_types ) ) || ( $skip && is_front_page() ) ) {
if ( is_admin() || ( in_array( get_post_type(), $skipped_types, true ) ) || ( $skip && is_front_page() ) ) {
return;
}
@@ -56,7 +56,7 @@ class Display_Featured_Image_Genesis_Output {
$width = absint( $this->item->backstretch[1] );
$force_backstretch = apply_filters( 'display_featured_image_genesis_force_backstretch', array() );
if ( $width > $large || in_array( get_post_type(), $force_backstretch ) ) {
if ( $width > $large || in_array( get_post_type(), $force_backstretch, true ) ) {
$this->do_backstretch_image_things();
} else {
$this->do_large_image_things();
@@ -307,7 +307,7 @@ class Display_Featured_Image_Genesis_Output {
$move_excerpts = $this->displaysetting['move_excerpts'];
$omit_excerpt = apply_filters( 'display_featured_image_genesis_omit_excerpt', array() );
if ( $move_excerpts && ! in_array( get_post_type(), $omit_excerpt ) ) {
if ( $move_excerpts && ! in_array( get_post_type(), $omit_excerpt, true ) ) {
return true;
}
return false;
@@ -323,7 +323,7 @@ class Display_Featured_Image_Genesis_Output {
$keep_titles = $this->displaysetting['keep_titles'];
// if titles will be moved to overlay backstretch image
if ( ! $keep_titles && ! in_array( get_post_type(), $do_not_move_title ) ) {
if ( ! $keep_titles && ! in_array( get_post_type(), $do_not_move_title, true ) ) {
return true;
}
return false;
@@ -24,7 +24,7 @@ class Display_Featured_Image_Genesis_RSS {
$skipped_types = apply_filters( 'display_featured_image_genesis_skipped_posttypes', $post_types );
// if the user isn't sending images to the feed, we're done
if ( ! $feed_image || ( in_array( get_post_type(), $skipped_types ) ) ) {
if ( ! $feed_image || ( in_array( get_post_type(), $skipped_types, true ) ) ) {
return;
}