Skip to content

Commit

Permalink
add new runtime filter and update webpack value
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Sep 12, 2023
1 parent c21358b commit 792916b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function __construct() {
\add_action( 'admin_head', array( __CLASS__, 'admin_nav_style' ) );

\add_filter('newfold-runtime', array( __CLASS__, 'add_to_runtime' ) );
\add_filter('newfold_runtime', array( __CLASS__, 'add_to_runtime' ) );

if ( isset( $_GET['page'] ) && strpos( filter_input( INPUT_GET, 'page', FILTER_UNSAFE_RAW ), 'bluehost' ) >= 0 ) { // phpcs:ignore
\add_action( 'admin_footer_text', array( __CLASS__, 'add_brand_to_admin_footer' ) );
Expand Down
8 changes: 4 additions & 4 deletions inc/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public static function runtime() {
$runtime = array(
'isJarvis' => $bluehost_module_container->get('isJarvis'),
'plugin' => array(
'url' => BLUEHOST_BUILD_URL,
'version' => BLUEHOST_PLUGIN_VERSION,
'assets' => BLUEHOST_PLUGIN_URL . 'assets/',
'brand' => $bluehost_module_container->plugin()->brand,
'url' => BLUEHOST_BUILD_URL,
'version' => BLUEHOST_PLUGIN_VERSION,
'assets' => BLUEHOST_PLUGIN_URL . 'assets/',
'brand' => $bluehost_module_container->plugin()->brand,
),
);

Expand Down
4 changes: 2 additions & 2 deletions src/webpack-public-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* so that lazy-loading works correctly. This value is set in /includes/Data.php in runtime().
*/
export default () => {
if ( 'undefined' !== typeof window.NewfoldRuntime && 'sdk' in window.NewfoldRuntime ) {
__webpack_public_path__ = window.NewfoldRuntime.sdk.plugin.url;
if ( 'undefined' !== typeof window.NewfoldRuntime && 'plugin' in window.NewfoldRuntime ) {
__webpack_public_path__ = window.NewfoldRuntime.plugin.url;
}
};

0 comments on commit 792916b

Please sign in to comment.