-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manage incompatibilities and add a filter to have all the rules
- Loading branch information
Showing
31 changed files
with
576 additions
and
425 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => 'bcd6cb4e252b3d42baa6'); | ||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => 'eccd1fcee4002381057b'); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
<?php | ||
namespace Webaxones\Consistency\Asset; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
use Webaxones\Consistency\Utils\Contracts\ActionInterface; | ||
use Webaxones\Consistency\Plugin; | ||
use const Webaxones\Consistency\PLUGIN_PATH; | ||
use const Webaxones\Consistency\PLUGIN_URL; | ||
use Webaxones\Consistency\Config\LocalizedRules; | ||
|
||
/** | ||
* Consistency's Assets | ||
* | ||
* This class declares Consistency's assets to be hooked | ||
* | ||
* @throws | ||
*/ | ||
class Asset implements ActionInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getActions(): array | ||
{ | ||
return [ 'enqueue_block_editor_assets' => [ 'enqueueEditorAsset' ] ]; | ||
} | ||
|
||
/** | ||
* Enqueue Editor Asset | ||
* | ||
* @return void | ||
*/ | ||
public function enqueueEditorAsset(): void | ||
{ | ||
$info = include PLUGIN_PATH . 'build/index.asset.php'; | ||
wp_enqueue_script( | ||
Plugin::PREFIX . '-editor-script', | ||
PLUGIN_URL . 'build/index.js', | ||
$info['dependencies'], | ||
$info['version'], | ||
true | ||
); | ||
|
||
// Convert dash style locales code to undescore style for JS | ||
$locales = LocalizedRules::$list; | ||
$locales = array_map( | ||
function ( $value ) { | ||
return array_map( | ||
function ( $value ) { | ||
return str_replace( '-', '_', $value ); | ||
}, | ||
$value | ||
); | ||
}, | ||
$locales | ||
); | ||
|
||
// Pass localized rules to the script | ||
$localizedRules = 'const localesByRules = ' . json_encode( $locales ); | ||
wp_add_inline_script( | ||
Plugin::PREFIX . '-editor-script', | ||
$localizedRules, | ||
'before' | ||
); | ||
|
||
wp_set_script_translations( Plugin::PREFIX . '-editor-script', 'consistency' ); | ||
} | ||
} | ||
<?php | ||
namespace Webaxones\Consistency\Asset; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
use Webaxones\Consistency\Utils\Contracts\ActionInterface; | ||
use Webaxones\Consistency\Plugin; | ||
use const Webaxones\Consistency\PLUGIN_PATH; | ||
use const Webaxones\Consistency\PLUGIN_URL; | ||
use Webaxones\Consistency\Config\LocalizedRules; | ||
|
||
/** | ||
* Consistency's Assets | ||
* | ||
* This class declares Consistency's assets to be hooked | ||
* | ||
* @throws | ||
*/ | ||
class Asset implements ActionInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getActions(): array | ||
{ | ||
return [ 'enqueue_block_editor_assets' => [ 'enqueueEditorAsset' ] ]; | ||
} | ||
|
||
/** | ||
* Enqueue Editor Asset | ||
* | ||
* @return void | ||
*/ | ||
public function enqueueEditorAsset(): void | ||
{ | ||
$info = include PLUGIN_PATH . 'build/index.asset.php'; | ||
wp_enqueue_script( | ||
Plugin::PREFIX . '-editor-script', | ||
PLUGIN_URL . 'build/index.js', | ||
$info['dependencies'], | ||
$info['version'], | ||
true | ||
); | ||
|
||
// Convert dash style locales code to undescore style for JS | ||
$locales = LocalizedRules::$list; | ||
$locales = array_map( | ||
function ( $value ) { | ||
return array_map( | ||
function ( $value ) { | ||
return str_replace( '-', '_', $value ); | ||
}, | ||
$value | ||
); | ||
}, | ||
$locales | ||
); | ||
|
||
// Pass localized rules to the script | ||
$localizedRules = 'const localesByRules = ' . json_encode( $locales ); | ||
wp_add_inline_script( | ||
Plugin::PREFIX . '-editor-script', | ||
$localizedRules, | ||
'before' | ||
); | ||
|
||
wp_set_script_translations( Plugin::PREFIX . '-editor-script', 'consistency' ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Webaxones\Consistency\Config; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
use Webaxones\Consistency\Utils\Contracts\ValueInterface; | ||
|
||
/** | ||
* Localization Management | ||
*/ | ||
class LocalizationManagement implements ValueInterface | ||
{ | ||
/** | ||
* Indicates whether the management of correction localization is enabled. | ||
* | ||
* @var bool | ||
*/ | ||
protected bool $isLocalizationManaged; | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public function __construct( bool $isLocalizationManaged ) | ||
{ | ||
$this->isLocalizationManaged = $isLocalizationManaged; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function build(): bool | ||
{ | ||
return $this->isLocalizationManaged ?? true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.