now we can add attributes to js files using the tools class
This commit is contained in:
@@ -59,7 +59,8 @@ function fipf_paypal_shortcode_content()
|
||||
// 'js/paypal/result_message.js',
|
||||
// 'js/paypal/create_order.js',
|
||||
// 'js/paypal/on_approve.js',
|
||||
"js/paypal/paypal.js",
|
||||
//"js/paypal/paypal.js",
|
||||
array("js/paypal/paypal.js", 'type'=>'module'),
|
||||
"html/paypal/paypal.html",
|
||||
),
|
||||
);
|
||||
@@ -71,7 +72,6 @@ function fipf_paypal_shortcode_content()
|
||||
/**
|
||||
* the js file paypal.js needs to be imported as a module to use import
|
||||
* @see https://developer.wordpress.org/reference/hooks/script_loader_tag/
|
||||
*/
|
||||
function fipf_add_id_to_script( $tag, $handle, $src ) {
|
||||
if ( $handle === 'PLGNTLS_paypal_js' ) {
|
||||
$tag = '<script type="module" src="' . esc_url( $src ) . '" ></script>';
|
||||
@@ -79,6 +79,7 @@ function fipf_add_id_to_script( $tag, $handle, $src ) {
|
||||
return $tag;
|
||||
}
|
||||
add_filter( 'script_loader_tag', 'fipf_add_id_to_script', 10, 3 );
|
||||
*/
|
||||
|
||||
|
||||
// handling routes and endpoints
|
||||
|
||||
Reference in New Issue
Block a user