Skip to main content
added 1 character in body
Source Link
Peter HvD
  • 1.1k
  • 1
  • 6
  • 16

enqueue_scripts() is not a hook which actually outputs anything by itself as it is run before the page is constructed - any output you put in there (which you shouldn't anyway) will be wiped away when the page is displayed. What it does is to add your script files to the list of scripts which will be printed by the wp_head() or wp_footer() functions.

The best way to test a non-printing hook is to add something like

echo "<h1>CASH ME INSIDE</h1>"; wp_die();

the 2nd part of which will cause everything to come to an abrupt halt, thus not replacing your output with the actual page.

Hope that helps

enqueue_scripts() is not a hook which actually outputs anything by itself as it is run before the page is constructed - any output you put in there (which you shouldn't anyway) will be wiped away when the page is displayed. What it does is to add your script files to the list of scripts which will be printed by the wp_head() or wp_footer() functions.

The best way to test a non-printing hook is to add something like

echo "<h1>CASH ME INSIDE</h1>"; wp_die()

the 2nd part of which will cause everything to come to an abrupt halt, thus not replacing your output with the actual page.

Hope that helps

enqueue_scripts() is not a hook which actually outputs anything by itself as it is run before the page is constructed - any output you put in there (which you shouldn't anyway) will be wiped away when the page is displayed. What it does is to add your script files to the list of scripts which will be printed by the wp_head() or wp_footer() functions.

The best way to test a non-printing hook is to add something like

echo "<h1>CASH ME INSIDE</h1>"; wp_die();

the 2nd part of which will cause everything to come to an abrupt halt, thus not replacing your output with the actual page.

Hope that helps

Source Link
Peter HvD
  • 1.1k
  • 1
  • 6
  • 16

enqueue_scripts() is not a hook which actually outputs anything by itself as it is run before the page is constructed - any output you put in there (which you shouldn't anyway) will be wiped away when the page is displayed. What it does is to add your script files to the list of scripts which will be printed by the wp_head() or wp_footer() functions.

The best way to test a non-printing hook is to add something like

echo "<h1>CASH ME INSIDE</h1>"; wp_die()

the 2nd part of which will cause everything to come to an abrupt halt, thus not replacing your output with the actual page.

Hope that helps