Skip to content

Commit

Permalink
update package: control-checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
contactjavas committed Jan 24, 2022
1 parent 6857a2d commit 9fad902
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions packages/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,25 +320,25 @@
},
{
"name": "kirki-framework/control-checkbox",
"version": "v1.0.4",
"version_normalized": "1.0.4.0",
"version": "v1.0.5",
"version_normalized": "1.0.5.0",
"source": {
"type": "git",
"url": "https://github.com/kirki-framework/control-checkbox.git",
"reference": "47d51244a6f2088ec5945a524433e93d3fbef96e"
"reference": "3644c35369a9d6a23bc539522d2ace6e0740db57"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kirki-framework/control-checkbox/zipball/47d51244a6f2088ec5945a524433e93d3fbef96e",
"reference": "47d51244a6f2088ec5945a524433e93d3fbef96e",
"url": "https://api.github.com/repos/kirki-framework/control-checkbox/zipball/3644c35369a9d6a23bc539522d2ace6e0740db57",
"reference": "3644c35369a9d6a23bc539522d2ace6e0740db57",
"shasum": ""
},
"require": {
"kirki-framework/control-base": "*",
"kirki-framework/url-getter": "*",
"php": ">=7.0"
},
"time": "2022-01-21T14:58:22+00:00",
"time": "2022-01-24T16:31:59+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down Expand Up @@ -366,7 +366,7 @@
],
"support": {
"issues": "https://github.com/kirki-framework/control-checkbox/issues",
"source": "https://github.com/kirki-framework/control-checkbox/tree/v1.0.4"
"source": "https://github.com/kirki-framework/control-checkbox/tree/v1.0.5"
},
"install-path": "../kirki-framework/control-checkbox"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'bcf5a570c727055075a040bebafca3f7587c789c',
'reference' => '6857a2db67b3838010dcc8b63933f551901db3f7',
'name' => 'kirki-framework/kirki',
'dev' => true,
),
Expand Down Expand Up @@ -47,12 +47,12 @@
'dev_requirement' => false,
),
'kirki-framework/control-checkbox' => array(
'pretty_version' => 'v1.0.4',
'version' => '1.0.4.0',
'pretty_version' => 'v1.0.5',
'version' => '1.0.5.0',
'type' => 'library',
'install_path' => __DIR__ . '/../kirki-framework/control-checkbox',
'aliases' => array(),
'reference' => '47d51244a6f2088ec5945a524433e93d3fbef96e',
'reference' => '3644c35369a9d6a23bc539522d2ace6e0740db57',
'dev_requirement' => false,
),
'kirki-framework/control-code' => array(
Expand Down Expand Up @@ -313,7 +313,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'bcf5a570c727055075a040bebafca3f7587c789c',
'reference' => '6857a2db67b3838010dcc8b63933f551901db3f7',
'dev_requirement' => false,
),
'kirki-framework/l10n' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Checkbox extends Field {
* @return array
*/
public function filter_setting_args( $args, $wp_customize ) {

if ( $args['settings'] === $this->args['settings'] ) {
$args = parent::filter_setting_args( $args, $wp_customize );

Expand All @@ -65,8 +66,13 @@ public function filter_setting_args( $args, $wp_customize ) {
return ( '0' === $value || 'false' === $value ) ? false : (bool) $value;
};
}

// Make sure the default is formatted as boolean.
$args['default'] = (bool) ( 1 === $args['default'] || '1' === $args['default'] || true === $args['default'] || 'true' === $args['default'] || 'on' === $args['default'] );
}

return $args;

}

/**
Expand All @@ -79,10 +85,13 @@ public function filter_setting_args( $args, $wp_customize ) {
* @return array
*/
public function filter_control_args( $args, $wp_customize ) {

if ( $args['settings'] === $this->args['settings'] ) {
$args = parent::filter_control_args( $args, $wp_customize );
$args['type'] = 'kirki-checkbox';
}

return $args;

}
}

0 comments on commit 9fad902

Please sign in to comment.