Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【確認済】get_balloon_meta_optionsデフォルト値の取得方法調整 #1380

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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