Skip to content

Commit

Permalink
controls updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rezakhan995 committed Jun 10, 2020
1 parent f063f61 commit dd3b10b
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 676 deletions.
246 changes: 126 additions & 120 deletions devmonsta/options/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,119 +55,119 @@ public function register_controls() {
* ===========================================
*/

/**
* 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
*/
$this->add_control( [
'id' => 'dm_dropdown_pages',
'type' => 'dropdown-pages',
'section' => 'devmonsta_text_settings_section', // Add a default or your own section
'label' => __( 'Custom Dropdown Pages' ),
'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
*/
$this->add_control( [
'id' => 'person_hair_color',
'label' => __( 'Hair Color', 'devmonsta' ),
'type' => 'color',
'section' => 'devmonsta_text_settings_section',
'default' => '#eeee22',
] );

/**
* Control for media-select input
*/
$this->add_control( [
'id' => 'dm_media',
'type' => 'media',
'section' => 'devmonsta_text_settings_section',
'label' => __( 'Media', 'devmonsta' ),
] );
// /**
// * 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
// */
// $this->add_control( [
// 'id' => 'dm_dropdown_pages',
// 'type' => 'dropdown-pages',
// 'section' => 'devmonsta_text_settings_section', // Add a default or your own section
// 'label' => __( 'Custom Dropdown Pages' ),
// '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
// */
// $this->add_control( [
// 'id' => 'person_hair_color',
// 'label' => __( 'Hair Color', 'devmonsta' ),
// 'type' => 'color',
// 'section' => 'devmonsta_text_settings_section',
// 'default' => '#eeee22',
// ] );

// /**
// * Control for media-select input
// */
// $this->add_control( [
// 'id' => 'dm_media',
// 'type' => 'media',
// 'section' => 'devmonsta_text_settings_section',
// 'label' => __( 'Media', 'devmonsta' ),
// ] );

/**
* ===========================================
Expand Down Expand Up @@ -233,12 +233,12 @@ public function register_controls() {
'label' => __( 'Date Time Range Picker', '{domain}' ),
'desc' => __( 'date time range picker description', '{domain}' ),
'datetime-picker' => [
'date-format' => 'Y-m-d', // Format datetime.
'time-format' => 'H:i', // Format datetime.
'min-date' => "10-05-2020 12:00", // 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
'timepicker' => true, // Show timepicker.
'default-time' => '12:00', // If the input value is empty, timepicker will set time use defaultTime.
'date-format' => 'Y-m-d', // Format datetime.
'time-format' => 'H:i', // Format datetime.
'min-date' => "10-05-2020 12:00", // 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
'timepicker' => true, // Show timepicker.
'defaultTime' => '12:00', // If the input value is empty, timepicker will set time use defaultTime.
],
] );

Expand Down Expand Up @@ -501,7 +501,6 @@ public function register_controls() {
$this->add_control( [
'id' => 'typo',
'section' => 'devmonsta_text_settings_section',
'name' => '',
'type' => 'typography',
'value' => [
'family' => 'Amarante',
Expand All @@ -525,6 +524,13 @@ public function register_controls() {
'desc' => __( 'Description', '{domain}' ),
] );

// $this->add_control( [
// 'id' => 'dm_html_editor_one',
// 'lable' => __( 'HTML Editor', 'devmonsta' ),
// 'section' => 'devmonsta_text_settings_section',
// 'type' => 'html-editor',
// ] );

/**
* ===========================================
* Custom control end
Expand Down
Loading

0 comments on commit dd3b10b

Please sign in to comment.