Start working on settings field types - #45
This commit is contained in:
@ -81,9 +81,10 @@ class CWV2_Admin {
|
||||
$this->options_page,
|
||||
$section['id'],
|
||||
array(
|
||||
'id' => $this->option_prefix . $option_data['id'],
|
||||
'name' => $this->option_prefix . $option_data['id'],
|
||||
'desc' => $option_data['desc']
|
||||
'id' => $this->option_prefix . $option_data['id'],
|
||||
'name' => $this->option_prefix . $option_data['id'],
|
||||
'desc' => $option_data['desc'],
|
||||
'options' => isset( $option_data['options'] ) ? $option_data['options'] : false,
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -307,9 +308,9 @@ class CWV2_Admin {
|
||||
),
|
||||
),
|
||||
array(
|
||||
'id' => 'entry-settings',
|
||||
'name' => __( 'Dialog Settings', 'content-warning-v2' ),
|
||||
'group' => 'def_group',
|
||||
'id' => 'entry-settings',
|
||||
'name' => __( 'Dialog Settings', 'content-warning-v2' ),
|
||||
'group' => 'def_group',
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => 'd_title',
|
||||
|
@ -6,29 +6,68 @@ class CWV2_Settings {
|
||||
public function def_group() {
|
||||
|
||||
}
|
||||
public function check( $args = array() ) {
|
||||
|
||||
/**
|
||||
* Just gets a default set of arguments to make sure they're always set.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @author JayWood
|
||||
* @return array
|
||||
*/
|
||||
private function get_default_args( $args ) {
|
||||
return wp_parse_args( $args, array(
|
||||
'id' => '',
|
||||
'name' => '',
|
||||
'desc' => '',
|
||||
'default' => '',
|
||||
'options' => false,
|
||||
) );
|
||||
|
||||
}
|
||||
|
||||
public function check( $args = array() ) {
|
||||
$args = $this->get_default_args( $args );
|
||||
|
||||
$field_id = $args['id'];
|
||||
$description = $args['desc'];
|
||||
$options = $args['options'];
|
||||
if ( ! $options ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?><fieldset><?php
|
||||
foreach ( $options as $id => $label ) {
|
||||
|
||||
}
|
||||
?></fieldset><?php
|
||||
}
|
||||
|
||||
public function number( $args = array() ) {
|
||||
|
||||
}
|
||||
|
||||
public function text( $args = array() ) {
|
||||
|
||||
}
|
||||
|
||||
public function radio( $args = array() ) {
|
||||
|
||||
}
|
||||
|
||||
public function media( $args = array() ) {
|
||||
|
||||
}
|
||||
|
||||
public function color( $args = array() ) {
|
||||
|
||||
}
|
||||
|
||||
public function textbox( $args = array() ) {
|
||||
|
||||
}
|
||||
|
||||
private function _text_input( $args = array() ) {
|
||||
public function editor( $args = array() ) {
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user