Skip to main content
added 22 characters in body
Source Link
D Flexer
  • 33
  • 1
  • 5

I have tried following the codex following various threads here, simple, copy-paste various examples but to no avail. It just doesn't work.

Has it been depreciated? Has anyone got this to work in any recent version of WP or 5.7 specifically

 function my_scripts() { wp_enqueue_script( 'bs-popper', 'https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js', array('jquery'), _S_VERSION, true ); wp_script_add_data('bs-popper' , array('integrity') , array('sha384-XXXXXXXXXXXXXXXX'));  } add_action( 'wp_enqueue_scripts', 'my_scripts' ); 

} add_action( 'wp_enqueue_scripts', 'my_scripts' ); [EDIT] Simple [EDIT] Simple: Above Above example was from a version that had more than one but this simple one doesn't work either wp_script_add_data('bs-popper' , 'integrity' , 'sha384-XXXXXXX');

wp_script_add_data('bs-popper' , 'integrity' , 'sha384-XXXXXXX'); 

I have tried following the codex following various threads here, simple, copy-paste various examples but to no avail. It just doesn't work.

Has it been depreciated? Has anyone got this to work in any recent version of WP or 5.7 specifically

 function my_scripts() { wp_enqueue_script( 'bs-popper', 'https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js', array('jquery'), _S_VERSION, true ); wp_script_add_data('bs-popper' , array('integrity') , array('sha384-XXXXXXXXXXXXXXXX')); 

} add_action( 'wp_enqueue_scripts', 'my_scripts' ); [EDIT] Simple: Above example was from a version that had more than one but this simple one doesn't work either wp_script_add_data('bs-popper' , 'integrity' , 'sha384-XXXXXXX');

I have tried following the codex following various threads here, simple, copy-paste various examples but to no avail. It just doesn't work.

Has it been depreciated? Has anyone got this to work in any recent version of WP or 5.7 specifically

 function my_scripts() { wp_enqueue_script( 'bs-popper', 'https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js', array('jquery'), _S_VERSION, true ); wp_script_add_data('bs-popper' , array('integrity') , array('sha384-XXXXXXXXXXXXXXXX'));  } add_action( 'wp_enqueue_scripts', 'my_scripts' ); 

[EDIT] Simple: Above example was from a version that had more than one but this simple one doesn't work either

wp_script_add_data('bs-popper' , 'integrity' , 'sha384-XXXXXXX'); 
Source Link
D Flexer
  • 33
  • 1
  • 5

wp_script_add_data doesn't seem to work

I have tried following the codex following various threads here, simple, copy-paste various examples but to no avail. It just doesn't work.

Has it been depreciated? Has anyone got this to work in any recent version of WP or 5.7 specifically

 function my_scripts() { wp_enqueue_script( 'bs-popper', 'https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js', array('jquery'), _S_VERSION, true ); wp_script_add_data('bs-popper' , array('integrity') , array('sha384-XXXXXXXXXXXXXXXX')); 

} add_action( 'wp_enqueue_scripts', 'my_scripts' ); [EDIT] Simple: Above example was from a version that had more than one but this simple one doesn't work either wp_script_add_data('bs-popper' , 'integrity' , 'sha384-XXXXXXX');