Archived topic
PHP Execution
3 replies · Started by keri on January 29, 2019
Hi, I really need php execution in elements but also I need to set
define( 'DISALLOW_FILE_EDIT', true );
in wp-config.php for security and I used https://docs.generatepress.com/article/disallow-php-execution/#removing-the-admin-message code by Snippet plugin but it doesn't work - I still can't use php in elements hook. Please help.
Hi there,
You can tell Elements to execute PHP regardless like this:
add_filter( 'generate_hooks_execute_php', '__return_true' );
Let me know if that helps or not :)
Yes, it works very good and also I have "DISALLOW_FILE_EDIT’, true", thank you very much! But is this good for security of WP? If yes it should be in GPP documentation, I think.
If someone were to gain access to your Dashboard (already very bad), they could potentially use PHP to gain access to your server. This is why DISALLOW_FILE_EDIT is a good idea if your Dashboard is at risk.
If your Dashboard is locked down (2FA, strong password etc..), then you're likely in the clear :)