$endpoint, 'nonce' => Nonce::create( $endpoint ) ]; } ), $localize ); } wp_localize_script( $handle, $localize['name'], $localize['data'] ); } wp_enqueue_script( $handle ); if ( file_exists( "$pluginBasePath/dist/css/$app/styles.css" ) ) { wp_enqueue_style( $handle, "$pluginBaseUrl/dist/css/$app/styles.css", [], $version ); } if ( $domain && WordPress::versionCompare( '>=', '5.0.0' ) ) { $rootPath = $domain === 'wpml-translation-management' && defined( 'WPML_PLUGIN_PATH' ) ? WPML_PLUGIN_PATH : $pluginBasePath; wp_set_script_translations( $handle, $domain, "$rootPath/locale/jed" ); } } }