now we can add attributes to js files using the tools class

This commit is contained in:
asus
2024-02-27 15:23:07 +01:00
parent 7a8c0750c5
commit 2ce603e644
8 changed files with 217 additions and 107 deletions

View File

@@ -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