Skip to content

Commit

Permalink
update / get_balloon_meta_options
Browse files Browse the repository at this point in the history
get default value
  • Loading branch information
shimotmk committed Aug 19, 2022
1 parent 36d876f commit 871e570
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions inc/vk-blocks/class-vk-blocks-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 871e570

Please sign in to comment.