Hi, I searched and saw a few topics on this but there must be some kind of work around. Some security plugins add or when you manually add define(‘DISALLOW_FILE_EDIT’, true); to wp-config.php to protect the site, PHP isn’t able to execute when using some in element header hooks.
What is the solution? I haven’t yet seen one on this forum.
Hi Leo, no, what I mean is there must be a solution to use DISALLOW_FILE_EDIT to true and not have the element hook run PHP. 🙂 As I mentioned yes, security plugins do add the DISALLOW_FILE_EDIT to yes to wp-config.php so removing it is pointless if you’re securing the site. I already know that this is causing an issue.
I would like to be able to have DISALLOW_FILE_EDIT to yes and be able to use execute PHP in element hooks.
Yes!!!! This is exactly what I needed Leo. Thank you. So this function add_filter( 'generate_hooks_execute_php', '__return_true' ); enables PHP exectution in the element header but still disallows file edit site wide? I did try it and it works