From ba324a6a61a1b401eb054a96853c0e902170fca3 Mon Sep 17 00:00:00 2001 From: petrozavodsky Date: Fri, 14 Jan 2022 12:39:10 +0300 Subject: [PATCH 1/3] Fixed a typo --- admin-options.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-options.php b/admin-options.php index cf266f8..becd46b 100644 --- a/admin-options.php +++ b/admin-options.php @@ -86,6 +86,6 @@ function rfi_post_types_input_renderer() { function rfi_size_option_renderer(){ $dimensions = rfi_return_min_dimensions(); - echo ' width (px)
'; - echo ' height (px)
'; + echo ' width (px)
'; + echo ' height (px)
'; } From b8974c4b354f7962eb5b59797c1e2309e8caae05 Mon Sep 17 00:00:00 2001 From: petrozavodsky Date: Fri, 14 Jan 2022 12:48:00 +0300 Subject: [PATCH 2/3] Fix notice tying to access array offset on value of type bool ... If the option with the key 'fi_minimum_size'does not exist --- admin-options.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/admin-options.php b/admin-options.php index becd46b..bbfebc0 100644 --- a/admin-options.php +++ b/admin-options.php @@ -61,13 +61,9 @@ function rfi_return_post_types_which_support_featured_images() { } function rfi_return_min_dimensions() { - $minimum_size = get_option('rfi_minimum_size'); - if (isset($minimum_size['width']) && $minimum_size['width'] == 0) { - $minimum_size['width'] = 0; - } - if (isset($minimum_size['height']) && $minimum_size['height'] == 0) { - $minimum_size['height'] = 0; - } + $minimum_size = get_option( 'rfi_minimum_size', array() ); + $minimum_size = wp_parse_args( array( 'height' => 0, 'width' => 0 ), $minimum_size ); + return $minimum_size; } From 7ef031c209b594b9ce05d47bd02ea45d3ca00b12 Mon Sep 17 00:00:00 2001 From: petrozavodsky Date: Fri, 14 Jan 2022 14:17:49 +0300 Subject: [PATCH 3/3] Fix --- admin-options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-options.php b/admin-options.php index bbfebc0..88b7d17 100644 --- a/admin-options.php +++ b/admin-options.php @@ -62,7 +62,7 @@ function rfi_return_post_types_which_support_featured_images() { function rfi_return_min_dimensions() { $minimum_size = get_option( 'rfi_minimum_size', array() ); - $minimum_size = wp_parse_args( array( 'height' => 0, 'width' => 0 ), $minimum_size ); + $minimum_size = wp_parse_args( $minimum_size, array( 'height' => 0, 'width' => 0 ) ); return $minimum_size; }