[Resolved] DISALLOW_FILE_EDIT issue with Elements Create New Hook

Home Forums Support [Resolved] DISALLOW_FILE_EDIT issue with Elements Create New Hook

Home Forums Support DISALLOW_FILE_EDIT issue with Elements Create New Hook

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #660640
    Denise

    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

    #660731
    Tom
    Lead Developer
    Lead Developer

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

    Let me know 🙂

    #661723
    Denise

    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

    #661758
    Tom
    Lead Developer
    Lead Developer

    It won’t be overwritten – you should be good to go now 🙂

    #1319192
    Margaret

    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?

    #1319445
    David
    Staff
    Customer Support

    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/

    #1509095
    Lisa

    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

    #1509141
    David
    Staff
    Customer Support

    Hi there,

    instead of editing your WP-config, try adding this PHP snippet to your site:

    add_filter( 'generate_hooks_execute_php', '__return_true' );

    https://docs.generatepress.com/article/adding-php/

    #1509163
    Lisa

    Thanks that did it.

    #1509276
    David
    Staff
    Customer Support

    Glad to hear that

    #1527215
    Lisa

    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?

    #1527472
    Tom
    Lead Developer
    Lead Developer

    Hi there,

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

    #1527914
    Lisa

    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

    #1528091
    David
    Staff
    Customer Support

    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.

    #1528125
    Lisa

    ok. will do

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.