Description
The “ims_setting_fields” filter is used to add or remove option from the default options array. It affects the options when the plugin is installed or settings are reset.
A plugin (or theme) can modify the array with the code:
<?php add_filter( 'ims_setting_fields', 'filter_function_name' ); ?>
The hook is located in the image-store/admin/settings/settings.php file.
Example
// Apply filter
function modify_ims_setting_fields( $settings ) {
$settings['new_settings_tab'] = array(
'new_setting_field' => array(
'val' => 'default value',
'type' => 'text',
'label' => __( 'New Field',),
'desc' => __( 'description' ),
)
);
return $settings;
}
add_filter('ims_setting_fields', 'modify_ims_setting_fields');
Note: $settings is an multidimensional array. First level key must match a key in the tabs array returned by the ims_settings_tabs filter.
Leave a Reply