Skip to content

Instantly share code, notes, and snippets.

@ejntaylor
Last active August 29, 2015 14:01
Show Gist options
  • Save ejntaylor/315280ca778434145662 to your computer and use it in GitHub Desktop.
Save ejntaylor/315280ca778434145662 to your computer and use it in GitHub Desktop.
<?php
public function save_settings() {
if( isset($_REQUEST["{$this->prefix}_setting"]) && check_admin_referer("save_{$this->prefix}_settings","{$this->prefix}_save") ) {
$new_settings = $_REQUEST["{$this->prefix}_setting"];
foreach( $new_settings as $setting_name => $setting_value ) {
foreach( $setting_value as $type => $value ) {
echo '<br> t1 <br>';
if( is_array($value) ) {
if ( ! is_array($value) && ! empty($value) ) $value = (array)explode(";", $value);
echo 't2 <br>';
$this->update_setting($setting_name, $value);
} else {
$this->update_setting($setting_name, $value);
echo 't3 <br>';
}
echo 'var_dump all: ';
var_dump($this->get_field_name($setting_name, $value));
echo '<br>';
echo 'value: ';
var_dump ($value);
echo '<br>';
}
}
do_action("{$this->prefix}_settings_saved");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment