Skip to content

Commit b2418ec

Browse files
committed
add option config array filter
1 parent 411b29e commit b2418ec

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

classes/option.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class VP_Option
3636
public function __construct(array $configs)
3737
{
3838

39-
// extract and set default value
40-
extract($test = array_merge(array(
39+
// merge configs with default value
40+
$configs = array_merge(array(
4141
'is_dev_mode' => false,
4242
'use_auto_group_naming' => true,
4343
'use_util_menu' => true,
@@ -47,7 +47,14 @@ public function __construct(array $configs)
4747
'page_title' => __( 'Vafpress Options', 'vp_textdomain' ),
4848
'menu_label' => __( 'Vafpress Options', 'vp_textdomain' ),
4949
'priority' => 10,
50-
), $configs));
50+
), $configs);
51+
52+
// options config filter
53+
$configs = apply_filters('vp_option_configuration_array' , $configs, $configs['option_key']);
54+
$configs = apply_filters('vp_option_configuration_array-' . $configs['option_key'], $configs);
55+
56+
// extract the configs
57+
extract($configs);
5158

5259
// check and set required configs
5360
if(isset($option_key)) $this->set_option_key($option_key);

0 commit comments

Comments
 (0)