[Support request] Unable to execute PHP as DISALLOW_FILE_EDIT is defined Hook element

Home Forums Support [Support request] Unable to execute PHP as DISALLOW_FILE_EDIT is defined Hook element

Home Forums Support Unable to execute PHP as DISALLOW_FILE_EDIT is defined Hook element

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1612724
    Prathmesh

    Hey, I am getting this error “Unable to execute PHP as DISALLOW_FILE_EDIT is defined” while adding the hook element.

    Would you please help me fix the issue?

    Thanks

    #1612751
    Leo
    Staff
    Customer Support
    #1612833
    Prathmesh

    Hey Leo,

    Thanks for your reply.

    I already read that article but I didn’t get it.

    Basically, I want to add an author bio box using the hook element in my blog posts. And it requires PHP execution. But, as I mentioned earlier, I’m getting the error.

    So to get rid of the error and to execute PHP should I add the code mentioned in the article “define( ‘GENERATE_HOOKS_DISALLOW_PHP’, true );”?

    #1612942
    David
    Staff
    Customer Support

    Hi there,

    to enable PHP in just the hooks you would add the PHP Snippet provided here to your site:

    https://docs.generatepress.com/article/generate_hooks_execute_php/

    ie.

    add_filter( 'generate_hooks_execute_php', '__return_true' );

    Adding PHP to your site:
    https://docs.generatepress.com/article/adding-php/

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