Print on screen during shutdown hook – error during saving in theme-editor.php


I’m trying to use this sample php code added to my funcion.php file:

function echo_shutdown(){
  echo 'test';
add_action( 'shutdown', 'echo_shutdown', 10 );

It works, i can see “test” at the bottom of my page.

The problem is that if i save my file wordpress warn me with the message: “Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.”

I tried also various alternatives to echo: var_dump, print_r, exit(‘test’), ecc… also to use “register_shutdown_function” in place of shutdown wordpress hook. Same result.

When i try to output something during shutdown i receive this error message during saving.

There is a way to output something during shutdown hook without receive the warning?

gigito78 4 months 2022-07-18T02:58:52-05:00 0 Answers 0 views 0

Leave an answer