-
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.
Merge branch 'solutions' into improve/scripts-with-UI
* solutions: (31 commits) Update build Fix free plugin checks Update DataAttrListener.php Revert "Missed Changes" Missed Changes Update build Add free plugin installation Production build Fix version numbers Fix lint Update PLS data attributes Bump version Ran build Clean up code Remove blank line Simplify logic Update code formatting Update build Prevent the icon from shrinking Code formatting and use createInterpolateElement to handle translation and HTML safely ... # Conflicts: # build/1.2.0-beta.3/dataAttrListener.asset.php # build/1.2.0-beta.3/dataAttrListener.js # build/1.2.0-beta.3/installer.asset.php # build/1.2.0-beta.3/installer.css # build/1.2.0-beta.3/installer.js # package-lock.json # src/Installer/components/Modal/index.jsx # src/Scripts/dataAttrListener.js
- Loading branch information
Showing
17 changed files
with
2,539 additions
and
797 deletions.
There are no files selected for viewing
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 @@ | ||
v20 |
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('wp-dom-ready'), 'version' => 'bc22db3f938d48526ac3'); | ||
<?php return array('dependencies' => array('wp-dom-ready'), 'version' => 'd688a7c45dc137ed4ceb'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '0524aceb308f50d52f01'); | ||
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '20589e8ef523f5b2ed7b'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace NewfoldLabs\WP\Module\Installer\WPAdmin\Listeners; | ||
|
||
use NewfoldLabs\WP\Module\Installer\Services\PluginInstaller; | ||
|
||
/** | ||
* Manages all the data-* listening related functionalities for the module. | ||
*/ | ||
class DataAttrListener { | ||
/** | ||
* Constructor for the DataAttrListener class. | ||
*/ | ||
public function __construct() { | ||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_data_attr_listener' ) ); | ||
} | ||
|
||
/** | ||
* Enqueues the data-* attribute listener script. | ||
* | ||
* @return void | ||
*/ | ||
public function enqueue_data_attr_listener() { | ||
$asset_file = NFD_INSTALLER_BUILD_DIR . '/dataAttrListener.asset.php'; | ||
|
||
if ( is_readable( $asset_file ) ) { | ||
$asset = include $asset_file; | ||
|
||
wp_register_script( | ||
'nfd-installer-data-attr-listener', | ||
NFD_INSTALLER_BUILD_URL . '/dataAttrListener.js', | ||
array_merge( $asset['dependencies'], array() ), | ||
$asset['version'], | ||
true | ||
); | ||
|
||
wp_add_inline_script( | ||
'nfd-installer-data-attr-listener', | ||
'var nfdInstaller =' . wp_json_encode( | ||
value: array( | ||
'restUrl' => \get_home_url() . '/index.php?rest_route=', | ||
'pluginInstallHash' => PluginInstaller::rest_get_plugin_install_hash(), | ||
) | ||
) . ';', | ||
'before' | ||
); | ||
|
||
wp_enqueue_script( 'nfd-installer-data-attr-listener' ); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.