Site logo

Archived topic

DISALLOW_FILE_EDIT issue with Elements Create New Hook

15 replies · Started by Denise on August 26, 2018

Viewing posts 1–15 of 16

Hello GP Friends,

The GP Elements create new hook page displays the message:
Unable to execute PHP as DISALLOW_FILE_EDIT is defined.

My wp-config file is set at:
define( 'DISALLOW_FILE_MODS', FALSE );
define( 'DISALLOW_FILE_EDIT', FALSE );

I have deactivated all plugins except Generate Press, including Gutenberg and ACF.
I read the support notes at: https://docs.generatepress.com/article/disallow-php-execution/
What steps do you recommend?

Thanks,
Denise

Instead of defining those as false, try just removing them from wp-config.php.

Let me know :)

Hi Tom,

I commented out the line define( ‘DISALLOW_FILE_EDIT’, FALSE );
in the wp-config file.
That worked!
I was able to create a hook and use PHP.

Do you think this is an issue with Wordpress?
I wonder if it will get over-written with the next upgrade?
My hosting vendor is WP Engine and they install the upgrades and patches.

Thanks,
Denise

It won't be overwritten - you should be good to go now :)

Hello, I'm having the same issue with "Unable to execute PHP as DISALLOW_FILE_EDIT is defined." when trying to setup Breadcrumbs.

Can you help me locate the wp-config.php file?

Hi there,

the wp-config.php is located in the root directory of your WordPress install. So you would need to have FTP or console access to your server. You're host will be able to assist with that.

Alternatively if you want to enable PHP for your Hook elements then you can add this PHP function to your site:

add_filter( 'generate_hooks_execute_php', '__return_true' );

This article explains how to add that:
https://docs.generatepress.com/article/adding-php/

HI also having an issue with this.
I have this in my wpconfig.php
<?php
define("WP_DEBUG", false);
define( 'DISALLOW_FILE_EDIT', true );
define( 'GENERATE_HOOKS_DISALLOW_PHP', true );

what do I need to do to allow a script hook in on a specific page.
(this is an unsubscribe form for Constant Contact)

lisa

Thanks that did it.

Glad to hear that

David hi,
Im still have an issue with this code.
I added the line you gave me in snippets.
And originally I saw the code working (it is an unsubscribe form from constant contact)
But it is no longer showing on the front end.
any suggestions?

Hi there,

Are you still seeing the DISALLOW_FILE_EDIT error in the Elements editor when building your hook?

HI Tom
1. I pasted in elementor text area - not showing
2. I pasted in Elementor html widget - not showing
3. I added in GP elements Hook - to show only on this single page ;
placed 'generate_inside_site_container' - not showing

I am seeing a blank page - nothing is showing

Lisa

Hi there,

can you raise a new topic where you can use the Private Information to share a link to your site, if you want you can provide temporary admin access login, we cant take a look at what the issue is.

ok. will do

This archived topic is closed to new replies.