Site logo

Archived topic

define( 'GENERATE_HOOKS_DISALLOW_PHP', true );

2 replies · Started by Edwin on November 26, 2017

Viewing posts 1–3 of 3

Hi Tom

After adding "define( 'GENERATE_HOOKS_DISALLOW_PHP', true );" to wp-config i found that execute PHP under GP hooks stopped working.

After i removed it from wp-config it start working again.

Thanks

Edwin

Yes, that is exactly the behavior expected by defining define( ‘GENERATE_HOOKS_DISALLOW_PHP’, true ); in wp-config - the execution of php in hooks is prevented then. :-)

So what exactly was your concern? Why did you want to make this entry?

Maybe this reading this entry will help you:
Disallow PHP Execution

However, if you just want to hide the red admin hint, then paste the following code into your child theme's functions.php:

add_action( 'after_setup_theme', 'tu_remove_hooks_php_check' );
function tu_remove_hooks_php_check() {
    remove_action( 'admin_notices','generate_hooks_php_check' );
}

Thanks Roman :)

This archived topic is closed to new replies.