Archived topic
DISALLOW_FILE_EDIT
8 replies · Started by Jagoba on January 2, 2019
Hi there,
I don't know why but I have suddenly a plugin message like "DISALLOW_FILE_EDIT is defined. You should also disallow PHP execution in GP Hooks. Learn how". Why?
How can I solve it?
Hi there,
It is explained here: https://docs.generatepress.com/article/disallow-php-execution/
Where are you seeing the message?
On the wordpress manager, in the desk.
But why has it suddenly appeared? without any previous action?
It shouldn't. Nothing in GP premium has changed in regards to that.
Are you still using the old GP Hooks module?
I don't think so.
I don't understand which are the excat steps in https://docs.generatepress.com/article/disallow-php-execution/ to solve that
Just put this in wp_config?
add_action( 'after_setup_theme', 'tu_remove_hooks_php_check' );
function tu_remove_hooks_php_check() {
remove_action( 'admin_notices','generate_hooks_php_check' );
}
We don't have "define( 'DISALLOW_FILE_EDIT', true );" line in wp-config.php
It's just a warning message. If you want to remove it, then add this PHP snippet:
add_action( 'after_setup_theme', 'tu_remove_hooks_php_check' );
function tu_remove_hooks_php_check() {
remove_action( 'admin_notices','generate_hooks_php_check' );
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Where?
According to the link of the article that you have sent me, it is into the wp-config.php after this line:“define( ‘DISALLOW_FILE_EDIT’, true );”
And that line does not appear in my config.
The code Leo mentioned can be added using one of these methods: https://docs.generatepress.com/article/adding-php/
Let me know if it removes it for you or not :)
In the previous article: https://docs.generatepress.com/article/disallow-php-execution/
I understood different thing ...
So that message, "DISALLOW_FILE_EDIT is defined. You should also disallow PHP execution in GP Hooks. Learn how" in the WP desktop is not critical? Can I leave it?