Site logo

Archived topic

updating define( 'GENERATE_HOOKS_DISALLOW_PHP', true );

4 replies · Started by Russell on August 24, 2018

Viewing posts 1–5 of 5

on a localhost....

I recently updated to GP Elements. I noticed in Snippets, I have a bid of code

define( 'GENERATE_HOOKS_DISALLOW_PHP', true );

under the title of "disallowing php in gp hooks"

i've read this related article https://docs.generatepress.com/article/disallow-php-execution/

my questions are:
1) how does this code in snippets relate to the move to gp elements? does it stay or go?
2) I check the wp-config.php file and since I use themes security define( 'DISALLOW_FILE_EDIT', true ) is present.
3) with 1 & 2 above, do I create a new hook in elements? and if so, how do I do that, etc... or leave it as is? ect.

thanks.

Hi there,

If you have the code in 2) then you shouldn't need the code in 1).

You can still create new hooks in Hooks Element, they just can't include PHP code.

Let me know if this helps :)

After looking through the source code, I found the generate_hooks_execute_php filter. This code should replace the code in the documentation:

add_filter( 'generate_hooks_execute_php', '__return_true' );

Thanks!

I'll update the doc to include that filter.

This archived topic is closed to new replies.