'; // the title needs a hat icon echo get_screen_icon('magic-fields'); print '
and
tags when saving and show them in the HTML editor', $mf_domain )
),
'hide_post_panel' => array(
'id' => 'hide_post_panel',
'type' => 'checkbox',
'label' => __( 'Hide Wordpress Post panel' ),
'name' => "mf_settings[general][hide_post_panel]",
'value' => ( !empty( $options['hide_post_panel'] ) ) ? $options['hide_post_panel'] : 0,
'description' => __( 'Hide the post panel', $mf_domain )
),
'hide_page_panel' => array(
'id' => 'hide_page_panel',
'type' => 'checkbox',
'label' => __( 'Hide Wordpress Page panel' ),
'name' => "mf_settings[general][hide_page_panel]",
'value' => ( !empty( $options['hide_page_panel'] ) ) ? $options['hide_page_panel'] : 0,
'description' => __( 'Hide the page panel', $mf_domain )
)
),
'extra' => array(
'clear_cache' => array(
'id' => 'clear_cache',
'type' => 'checkbox',
'label' => __('Clear cache',$mf_domain),
'name' => "mf_settings[extra][clear_cache]",
'value' => 0,
'description' => __( 'delete all image thumbs', $mf_domain )
)
)
);
//update values
$settings = self::get();
if(is_array($settings)){
foreach($settings as $k => $v){
if( isset($data['general'][$k]) ){
$data['general'][$k]['value'] = $v;
}
}
}
return $data;
}
public function update($options) {
$options = serialize($options);
update_option(MF_SETTINGS_KEY, $options);
}
public static function get($key = null) {
if (get_option(MF_SETTINGS_KEY) == "") return "";
if (is_array(get_option(MF_SETTINGS_KEY)))
$options = get_option(MF_SETTINGS_KEY);
else
$options = unserialize(get_option(MF_SETTINGS_KEY));
if (!empty($key)){
if( isset($options[$key]) ) return $options[$key];
return false;
}else{
return $options;
}
}
function set($key, $val) {
$options = self::get();
$options[$key] = $val;
self::update($options);
}
}