diff --git a/composer.lock b/composer.lock index 6722ff023..c4edab763 100644 --- a/composer.lock +++ b/composer.lock @@ -1793,16 +1793,16 @@ }, { "name": "kirki-framework/module-postmessage", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/kirki-framework/module-postMessage.git", - "reference": "21dc54238435137181a43fccf248f4d2bc655a13" + "reference": "e53eb3361bae51b6453e67f3f8690c61b1254707" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kirki-framework/module-postMessage/zipball/21dc54238435137181a43fccf248f4d2bc655a13", - "reference": "21dc54238435137181a43fccf248f4d2bc655a13", + "url": "https://api.github.com/repos/kirki-framework/module-postMessage/zipball/e53eb3361bae51b6453e67f3f8690c61b1254707", + "reference": "e53eb3361bae51b6453e67f3f8690c61b1254707", "shasum": "" }, "require": { @@ -1835,9 +1835,9 @@ ], "support": { "issues": "https://github.com/kirki-framework/module-postMessage/issues", - "source": "https://github.com/kirki-framework/module-postMessage/tree/v1.0.4" + "source": "https://github.com/kirki-framework/module-postMessage/tree/v1.0.5" }, - "time": "2022-01-03T09:09:28+00:00" + "time": "2022-02-11T16:40:54+00:00" }, { "name": "kirki-framework/module-preset", diff --git a/packages/composer/autoload_psr4.php b/packages/composer/autoload_psr4.php index 9caf1d2d9..b76160d87 100644 --- a/packages/composer/autoload_psr4.php +++ b/packages/composer/autoload_psr4.php @@ -8,7 +8,7 @@ return array( 'Kirki\\Util\\' => array($vendorDir . '/kirki-framework/control-dashicons/src/Util', $vendorDir . '/kirki-framework/util/src'), 'Kirki\\Settings\\' => array($vendorDir . '/kirki-framework/control-repeater/src/Settings'), - 'Kirki\\Module\\' => array($vendorDir . '/kirki-framework/module-editor-styles/src', $vendorDir . '/kirki-framework/module-field-dependencies/src', $vendorDir . '/kirki-framework/module-postmessage/src', $vendorDir . '/kirki-framework/module-preset/src', $vendorDir . '/kirki-framework/module-section-icons/src', $vendorDir . '/kirki-framework/module-selective-refresh/src', $vendorDir . '/kirki-framework/module-tooltips/src', $vendorDir . '/kirki-framework/module-webfonts/src', $vendorDir . '/kirki-framework/module-css/src'), + 'Kirki\\Module\\' => array($vendorDir . '/kirki-framework/module-css/src', $vendorDir . '/kirki-framework/module-editor-styles/src', $vendorDir . '/kirki-framework/module-field-dependencies/src', $vendorDir . '/kirki-framework/module-preset/src', $vendorDir . '/kirki-framework/module-section-icons/src', $vendorDir . '/kirki-framework/module-selective-refresh/src', $vendorDir . '/kirki-framework/module-tooltips/src', $vendorDir . '/kirki-framework/module-webfonts/src', $vendorDir . '/kirki-framework/module-postmessage/src'), 'Kirki\\Field\\' => array($vendorDir . '/kirki-framework/control-checkbox/src/Field', $vendorDir . '/kirki-framework/control-code/src/Field', $vendorDir . '/kirki-framework/control-color/src/Field', $vendorDir . '/kirki-framework/control-color-palette/src/Field', $vendorDir . '/kirki-framework/control-custom/src/Field', $vendorDir . '/kirki-framework/control-dashicons/src/Field', $vendorDir . '/kirki-framework/control-date/src/Field', $vendorDir . '/kirki-framework/control-dimension/src/Field', $vendorDir . '/kirki-framework/control-editor/src/Field', $vendorDir . '/kirki-framework/control-generic/src/Field', $vendorDir . '/kirki-framework/control-image/src/Field', $vendorDir . '/kirki-framework/control-multicheck/src/Field', $vendorDir . '/kirki-framework/control-palette/src/Field', $vendorDir . '/kirki-framework/control-radio/src/Field', $vendorDir . '/kirki-framework/control-react-colorful/src/Field', $vendorDir . '/kirki-framework/control-react-select/src/Field', $vendorDir . '/kirki-framework/control-repeater/src/Field', $vendorDir . '/kirki-framework/control-select/src/Field', $vendorDir . '/kirki-framework/control-slider/src/Field', $vendorDir . '/kirki-framework/control-sortable/src/Field', $vendorDir . '/kirki-framework/control-upload/src/Field', $vendorDir . '/kirki-framework/field-background/src', $vendorDir . '/kirki-framework/field-dimensions/src', $vendorDir . '/kirki-framework/field-fontawesome/src/Field', $vendorDir . '/kirki-framework/field-multicolor/src/Field', $vendorDir . '/kirki-framework/field-typography/src/Field'), 'Kirki\\Data\\' => array($vendorDir . '/kirki-framework/data-option/src'), 'Kirki\\Control\\' => array($vendorDir . '/kirki-framework/control-base/src/Control', $vendorDir . '/kirki-framework/control-checkbox/src/Control', $vendorDir . '/kirki-framework/control-code/src/Control', $vendorDir . '/kirki-framework/control-color/src/Control', $vendorDir . '/kirki-framework/control-color-palette/src/Control', $vendorDir . '/kirki-framework/control-cropped-image/src', $vendorDir . '/kirki-framework/control-custom/src/Control', $vendorDir . '/kirki-framework/control-dashicons/src/Control', $vendorDir . '/kirki-framework/control-date/src/Control', $vendorDir . '/kirki-framework/control-dimension/src/Control', $vendorDir . '/kirki-framework/control-editor/src/Control', $vendorDir . '/kirki-framework/control-generic/src/Control', $vendorDir . '/kirki-framework/control-image/src/Control', $vendorDir . '/kirki-framework/control-multicheck/src/Control', $vendorDir . '/kirki-framework/control-palette/src/Control', $vendorDir . '/kirki-framework/control-radio/src/Control', $vendorDir . '/kirki-framework/control-react-colorful/src/Control', $vendorDir . '/kirki-framework/control-react-select/src/Control', $vendorDir . '/kirki-framework/control-repeater/src/Control', $vendorDir . '/kirki-framework/control-select/src/Control', $vendorDir . '/kirki-framework/control-slider/src/Control', $vendorDir . '/kirki-framework/control-sortable/src/Control', $vendorDir . '/kirki-framework/control-upload/src/Control', $vendorDir . '/kirki-framework/field-multicolor/src/Control', $vendorDir . '/kirki-framework/field-typography/src/Control'), diff --git a/packages/composer/autoload_static.php b/packages/composer/autoload_static.php index ee03e9bd3..e342db46e 100644 --- a/packages/composer/autoload_static.php +++ b/packages/composer/autoload_static.php @@ -40,15 +40,15 @@ class ComposerStaticInitc56aa391ac498061f8d648878e0e6144 ), 'Kirki\\Module\\' => array ( - 0 => __DIR__ . '/..' . '/kirki-framework/module-editor-styles/src', - 1 => __DIR__ . '/..' . '/kirki-framework/module-field-dependencies/src', - 2 => __DIR__ . '/..' . '/kirki-framework/module-postmessage/src', + 0 => __DIR__ . '/..' . '/kirki-framework/module-css/src', + 1 => __DIR__ . '/..' . '/kirki-framework/module-editor-styles/src', + 2 => __DIR__ . '/..' . '/kirki-framework/module-field-dependencies/src', 3 => __DIR__ . '/..' . '/kirki-framework/module-preset/src', 4 => __DIR__ . '/..' . '/kirki-framework/module-section-icons/src', 5 => __DIR__ . '/..' . '/kirki-framework/module-selective-refresh/src', 6 => __DIR__ . '/..' . '/kirki-framework/module-tooltips/src', 7 => __DIR__ . '/..' . '/kirki-framework/module-webfonts/src', - 8 => __DIR__ . '/..' . '/kirki-framework/module-css/src', + 8 => __DIR__ . '/..' . '/kirki-framework/module-postmessage/src', ), 'Kirki\\Field\\' => array ( diff --git a/packages/composer/installed.json b/packages/composer/installed.json index 153a0a227..2b1014919 100644 --- a/packages/composer/installed.json +++ b/packages/composer/installed.json @@ -2122,17 +2122,17 @@ }, { "name": "kirki-framework/module-postmessage", - "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/module-postMessage.git", - "reference": "21dc54238435137181a43fccf248f4d2bc655a13" + "reference": "e53eb3361bae51b6453e67f3f8690c61b1254707" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kirki-framework/module-postMessage/zipball/21dc54238435137181a43fccf248f4d2bc655a13", - "reference": "21dc54238435137181a43fccf248f4d2bc655a13", + "url": "https://api.github.com/repos/kirki-framework/module-postMessage/zipball/e53eb3361bae51b6453e67f3f8690c61b1254707", + "reference": "e53eb3361bae51b6453e67f3f8690c61b1254707", "shasum": "" }, "require": { @@ -2140,7 +2140,7 @@ "kirki-framework/util": "*", "php": ">=7.0" }, - "time": "2022-01-03T09:09:28+00:00", + "time": "2022-02-11T16:40:54+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2167,7 +2167,7 @@ ], "support": { "issues": "https://github.com/kirki-framework/module-postMessage/issues", - "source": "https://github.com/kirki-framework/module-postMessage/tree/v1.0.4" + "source": "https://github.com/kirki-framework/module-postMessage/tree/v1.0.5" }, "install-path": "../kirki-framework/module-postmessage" }, diff --git a/packages/composer/installed.php b/packages/composer/installed.php index 5489d1285..63c4cceb4 100644 --- a/packages/composer/installed.php +++ b/packages/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '7ae106fdc231ca01a302d0dfd39baf61c3356aec', + 'reference' => '93ec41440e75d4a4d27898b85ebafe4a4c5253f1', 'name' => 'kirki-framework/kirki', 'dev' => true, ), @@ -322,7 +322,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '7ae106fdc231ca01a302d0dfd39baf61c3356aec', + 'reference' => '93ec41440e75d4a4d27898b85ebafe4a4c5253f1', 'dev_requirement' => false, ), 'kirki-framework/l10n' => array( @@ -371,12 +371,12 @@ 'dev_requirement' => false, ), 'kirki-framework/module-postmessage' => 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/module-postmessage', 'aliases' => array(), - 'reference' => '21dc54238435137181a43fccf248f4d2bc655a13', + 'reference' => 'e53eb3361bae51b6453e67f3f8690c61b1254707', 'dev_requirement' => false, ), 'kirki-framework/module-preset' => array( diff --git a/packages/kirki-framework/module-postmessage/src/Postmessage.php b/packages/kirki-framework/module-postmessage/src/Postmessage.php index 2fa5c1715..f65241c16 100644 --- a/packages/kirki-framework/module-postmessage/src/Postmessage.php +++ b/packages/kirki-framework/module-postmessage/src/Postmessage.php @@ -63,6 +63,14 @@ public function field_add_setting_args( $args ) { // First we need to check if js_vars are empty, and that output is not empty. if ( empty( $args['js_vars'] ) && ! empty( $args['output'] ) ) { + // Convert to array of arrays if needed. + if ( isset( $args['output']['element'] ) ) { + /* translators: The field ID where the error occurs. */ + _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_html( $args['settings'] ) ), '3.0.10' ); + + $args['output'] = array( $args['output'] ); + } + foreach ( $args['output'] as $output ) { $output['element'] = isset( $output['element'] ) ? $output['element'] : ':root'; $output['element'] = is_array( $output['element'] ) ? implode( ',', $output['element'] ) : $output['element'];