[Resolved] Unable to execute PHP in Element when DISALLOW_FILE_EDIT is set to true

Home Forums Support [Resolved] Unable to execute PHP in Element when DISALLOW_FILE_EDIT is set to true

Home Forums Support Unable to execute PHP in Element when DISALLOW_FILE_EDIT is set to true

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1646231
    Aldrin

    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.

    #1646246
    Leo
    Staff
    Customer Support

    Hi there,

    The solution is different for every case – it depends on what is causing it.

    Are you using a security plugin?

    Does the message shown when all other plugins are disabled?

    Sometimes your hosting might have some default security that disallows the execution of PHP as well.

    #1646288
    Aldrin

    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.

    Hope I’m being clear

    #1646309
    Leo
    Staff
    Customer Support
    #1647492
    Aldrin

    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

    #1647625
    Leo
    Staff
    Customer Support

    Glad to hear ๐Ÿ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.