Skip to content

Commit

Permalink
customizer controls rearranged
Browse files Browse the repository at this point in the history
  • Loading branch information
rezakhan995 committed Jun 10, 2020
1 parent f80e080 commit 2edad70
Showing 1 changed file with 100 additions and 82 deletions.
182 changes: 100 additions & 82 deletions devmonsta/options/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,84 @@ public function register_controls() {
'priority' => 10,
] );



/**
* ===========================================
* Custom control start
* Default control start
* ===========================================
*/

/**
* Control for text input
*/
$this->add_control( [
'id' => 'dm_ctrl_text_1',
'type' => 'text',
'value' => 'default text',
'label' => __( 'Text Input', 'devmonsta' ),
'section' => 'devmonsta_text_settings_section',
] );

/**
* control for checkbox input
*/
$this->add_control( [
'id' => 'dm_checkbox',
'section' => 'devmonsta_text_settings_section',
'type' => 'checkbox',
'value' => false, // checked/unchecked
'label' => __( 'Checkbox example', '{domain}' ),
'desc' => __( "checkbox example details", '{domain}' ),
'text' => __( 'Yes', '{domain}' ),
] );

/**
* control for radio input
*/
$this->add_control( [
'type' => 'radio',
'id' => 'dm_test_readio',
'label' => __( 'Custom Radio Selection' ),
'description' => __( 'This is a custom radio input.' ),
'choices' => [
'red' => __( 'Red' ),
'blue' => __( 'Blue' ),
'green' => __( 'Green' ),
],
'section' => 'devmonsta_text_settings_section',
] );

/**
* control for dropdown select
*/
$this->add_control( [
'id' => 'select',
'section' => 'devmonsta_text_settings_section',
'type' => 'select',
'value' => 'choice-3',
'label' => __( 'Select Single', '{domain}' ),
'desc' => __( 'select description goes here', '{domain}' ),
'choices' => [
'' => '---',
'choice-1' => __( 'Choice One', '{domain}' ),
'choice-2' => __( 'Choice Two', '{domain}' ),
'choice-3' => __( 'Choice Three', '{domain}' ),
],
] );

/**
* control for textarea input
*/
$this->add_control( [
'id' => 'dm_textarea',
'type' => 'textarea',
'section' => 'devmonsta_text_settings_section',
'label' => __( 'Text area' ),
'description' => __( 'This is text area desctription' ),
"value" => 'default value for text area',
] );

/**
* Control for dropdown-page input
*/
Expand All @@ -74,6 +136,18 @@ public function register_controls() {
'description' => __( 'This is a custom dropdown pages option.' ),
] );

/**
* control for url input
*/
$this->add_control( [
'id' => 'dm_url',
'section' => 'devmonsta_text_settings_section',
'type' => 'url',
'value' => 'http://www.xs.com',
'label' => __( 'Enter valid URL', '{domain}' ),
'desc' => __( 'Url Description', '{domain}' ),
] );

/**
* Control for color-picker input
*/
Expand All @@ -92,35 +166,37 @@ public function register_controls() {
'id' => 'dm_media',
'type' => 'media',
'section' => 'devmonsta_text_settings_section',
'label' => __( 'Media' ),
'label' => __( 'Media', 'devmonsta' ),
] );

/**
* control for radio input
* ===========================================
* Default control end
* ===========================================
*/
$this->add_control( [
'type' => 'radio',
'id' => 'dm_test_readio',
'label' => __( 'Custom Radio Selection' ),
'description' => __( 'This is a custom radio input.' ),
'choices' => [
'red' => __( 'Red' ),
'blue' => __( 'Blue' ),
'green' => __( 'Green' ),
],
'section' => 'devmonsta_text_settings_section',
] );



/**
* control for textarea input
* ===========================================
* Custom control start
* ===========================================
*/


/**
* control for date-picker input
*/
$this->add_control( [
'id' => 'dm_textarea',
'type' => 'textarea',
'section' => 'devmonsta_text_settings_section',
'label' => __( 'Text area' ),
'description' => __( 'This is text area desctription' ),
"value" => 'default value for text area',
'id' => 'start_date',
'section' => 'devmonsta_text_settings_section',
'type' => 'date-picker',
'value' => '2020/05/10 12:00 am',
'label' => __( 'Date Picker', '{domain}' ),
'desc' => __( 'date picker description goes here', '{domain}' ),
'monday-first' => true, // The week will begin with Monday; for Sunday, set to false
'min-date' => "10-05-2020", // By default minimum date will be current day. Set a date in format Y-m-d as a start date
'max-date' => null, // By default there is not maximum date. Set a date in format Y-m-d as a start date
] );

/**
Expand Down Expand Up @@ -166,31 +242,6 @@ public function register_controls() {
],
] );

/**
* control for checkbox input
*/
$this->add_control( [
'id' => 'dm_checkbox',
'section' => 'devmonsta_text_settings_section',
'type' => 'checkbox',
'value' => false, // checked/unchecked
'label' => __( 'Checkbox example', '{domain}' ),
'desc' => __( "checkbox example details", '{domain}' ),
'text' => __( 'Yes', '{domain}' ),
] );

/**
* control for url input
*/
$this->add_control( [
'id' => 'dm_url',
'section' => 'devmonsta_text_settings_section',
'type' => 'url',
'value' => 'http://www.xs.com',
'label' => __( 'Enter valid URL', '{domain}' ),
'desc' => __( 'Url Description', '{domain}' ),
] );

/**
* control for dimension input
*/
Expand Down Expand Up @@ -260,7 +311,7 @@ public function register_controls() {
] );

/**
* Control for Thumbnail Image picker Input
* Control for Image picker Input
*/
$this->add_control( [
'id' => 'i_p',
Expand Down Expand Up @@ -293,24 +344,6 @@ public function register_controls() {
],
] );

/**
* control for dropdown select
*/
$this->add_control( [
'id' => 'select',
'section' => 'devmonsta_text_settings_section',
'type' => 'select',
'value' => 'choice-3',
'label' => __( 'Select Single', '{domain}' ),
'desc' => __( 'select description goes here', '{domain}' ),
'choices' => [
'' => '---',
'choice-1' => __( 'Choice One', '{domain}' ),
'choice-2' => __( 'Choice Two', '{domain}' ),
'choice-3' => __( 'Choice Three', '{domain}' ),
],
] );

/**
* Control for Html input
*/
Expand Down Expand Up @@ -413,21 +446,6 @@ public function register_controls() {
'palettes' => ['#ba4e4e', '#5f9419', '#381994'],
] );

/**
* control for date-picker input
*/
$this->add_control( [
'id' => 'start_date',
'section' => 'devmonsta_text_settings_section',
'type' => 'date-picker',
'value' => '',
'label' => __( 'Date Picker', '{domain}' ),
'desc' => __( 'date picker description goes here', '{domain}' ),
'monday-first' => true, // The week will begin with Monday; for Sunday, set to false
'min-date' => "10-05-2020", // By default minimum date will be current day. Set a date in format Y-m-d as a start date
'max-date' => null, // By default there is not maximum date. Set a date in format Y-m-d as a start date
] );

/**
* control for icon-picker input
*/
Expand Down

0 comments on commit 2edad70

Please sign in to comment.