Archived topic
Disable PHP Execution in Hooks?
3 replies · Started by arthur on November 17, 2017
Hi I just found this because file edit was true in wp-config: https://docs.generatepress.com/article/disallow-php-execution/
Does this mean that even if the checkbox marked 'allow php execution' is checked, it still won't run php commands?
thanks!
That's correct - if executing PHP in hooks is disabled in your wp-config.php file, no PHP will be executed inside them (even if it's already set).
Okay. So as of now I don't need PHP in hooks - however, it seems like allowing PHP in hooks is not secure - so if I need to execute PHP at a hook point, what do I do? Write it into the functions.php file?
You would remove the code to disable PHP execution.
The default is allowing PHP execution.
Code should be added using one of these methods: https://docs.generatepress.com/article/adding-php/