type = 'group'; if(isset($var['name'])){ $this->name = $var['name']; $this->slug = strtolower(str_replace(' ', '_', $this->name)); } if(isset($var['description'])) $this->description = $var['description']; if(isset($var['dropdowns'])) $this->dropdowns = $var['dropdowns']; if(isset($var['checkboxes'])) $this->checkboxes = $var['checkboxes']; if(isset($var['inputs'])) $this->inputs = $var['inputs']; if(isset($var['textareas'])) $this->textareas = $var['textareas']; } function register_settings(){ if(isset($this->dropdowns)): foreach($this->dropdowns as $key=>$cb): $name='ab_'.strtolower(str_replace(' ', '_', $key)); register_setting('ab_custom_options', (string)$name); endforeach; endif; if(isset($this->checkboxes)): foreach($this->checkboxes as $key=>$cb): $name='ab_'.$key; register_setting('ab_custom_options', $name); endforeach; endif; if(isset($this->inputs)): foreach($this->inputs as $key=>$cb): $name='ab_'.$key; register_setting('ab_custom_options', $name); endforeach; endif; if(isset($this->textareas)): foreach($this->textareas as $key=>$cb): $name='ab_'.$key; register_setting('ab_custom_options', $name); endforeach; endif; } function print_settings(){ ?>

name ?>

description) echo '

' .$this->description .'

'; ?> dropdowns)) $this->print_admin_dropdowns(); ?> checkboxes)) $this->print_admin_checkboxes(); ?> inputs)) $this->print_admin_inputs(); ?> textareas)) $this->print_admin_textareas(); ?>
' .$this->name .''; } function print_fancy_settings(){ ?>

name ?>

description) echo '

' .$this->description .'

'; ?> dropdowns)) $this->print_admin_dropdowns(); ?> checkboxes)) $this->print_admin_checkboxes(); ?> inputs)) $this->print_admin_inputs(); ?> textareas)) $this->print_admin_textareas(); ?>
dropdowns as $key=>$dd): $name = 'ab_' .strtolower(str_replace(' ', '_', $key)); $op = get_option($name); echo $this->get_wrapper($key); ?>get_wrapper(); endforeach; } function print_admin_checkboxes(){ foreach($this->checkboxes as $key=>$i): $name='ab_'.$key; echo $this->get_wrapper($i); ?> type="checkbox" name="" value="1" /> Yes please!get_wrapper(); endforeach; } function print_admin_inputs(){ foreach($this->inputs as $key=>$i): $name='ab_'.$key; echo $this->get_wrapper($i); ?>get_wrapper(); endforeach; } function print_admin_textareas(){ foreach($this->textareas as $key=>$i): $name='ab_'.$key; echo $this->get_wrapper($i); ?>get_wrapper(); endforeach; } function get_wrapper($name=""){ return ($name=="") ? '' : '' .$name .':'; } } ?>