From 871e570dcc39d33a7d39d65e1bc9e8513d377552 Mon Sep 17 00:00:00 2001 From: shimotmk Date: Fri, 19 Aug 2022 16:04:03 +0900 Subject: [PATCH] update / get_balloon_meta_options get default value --- inc/vk-blocks/class-vk-blocks-options.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/inc/vk-blocks/class-vk-blocks-options.php b/inc/vk-blocks/class-vk-blocks-options.php index 27eda8bb2..9b36ba23a 100644 --- a/inc/vk-blocks/class-vk-blocks-options.php +++ b/inc/vk-blocks/class-vk-blocks-options.php @@ -122,7 +122,7 @@ public static function balloon_image_number() { * * @return $balloon_meta_schema */ - public function balloon_meta_schema() { + public static function balloon_meta_schema() { $number = self::balloon_image_number(); $return_array = array(); $return_array['default_icons'] = array( @@ -188,17 +188,9 @@ public static function get_properties( $schema ) { * @return options */ public static function get_balloon_meta_options() { - $options = get_option( 'vk_blocks_balloon_meta' ); - $number = self::balloon_image_number(); - $defaults = array(); - $defaults['default_icons'] = array(); - for ( $i = 1; $i <= $number; $i++ ) { - $defaults['default_icons'][ $i ] = array( - 'name' => null, - 'src' => null, - ); - }; - $options = wp_parse_args( $options, $defaults ); + $options = get_option( 'vk_blocks_balloon_meta' ); + $defaults = self::get_properties( self::balloon_meta_schema() ); + $options = wp_parse_args( $options, $defaults ); return $options; }