Black Friday sale! Get up to 25% off GP Premium! Learn more ➝

[Support request] Disable PHP Execution in Hooks?

Home Forums Support [Support request] Disable PHP Execution in Hooks?

Home Forums Support Disable PHP Execution in Hooks?

  • This topic has 3 replies, 3 voices, and was last updated 6 years ago by Leo.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #426868
    arthur

    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!

    #426932
    Tom
    Lead Developer
    Lead Developer

    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).

    #430208
    arthur

    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?

    #430231
    Leo
    Staff
    Customer Support

    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/

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