Site logo

Archived topic

DISALLOW_FILE_EDIT', true ); PHP hook

10 replies · Started by Matt on January 16, 2023

Viewing posts 1–11 of 11

I'm using a breadcrumb plugin and hook element to execute the following.

I had this in my wp-config.pho file and it was preventing the above element from running.

('DISALLOW_FILE_EDIT', 'true');

Is there a fix or a workaround for this?

Not understanding.

3. Hook element is what I'm using.

3. is the Using Functions method in that doc:

https://www.screencast.com/t/YgOf4Vj4fC1

You don't use a GP Hook Element.
You would add the code using one of the methods provided here:

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

TLDR: Are you using a Child Theme?
If Yes, then that code goes in your Child Theme functions.php
If No, then install the Code Snippets plugin ( link in the doc above ) and add the code to a new snippet.

This method also applies to option 2

It is not a child theme.

If I use the code snippet plugin how do I exclude certain posts? With the hook element, I can choose to display only on posts and exclude certain posts.

Do you use the Block Editor ?

If Yes, you can create a Block Element instead, and add the Yoast Breadcrumb Block.

Appearance -> Elements -> is how I created it.

Again... MY issue is I had to comment out the line below in my wp-config.php for the element to work.

(‘DISALLOW_FILE_EDIT’, ‘true’);

Also I'm using the Breadcrumb NavXT plugin not yoast.

1. Add new Code Snippet
1.1 Add this code to your snippet:

add_filter( 'generate_hooks_execute_php', '__return_true' );

1.2 Save the Snippet.

2. Then create your GP Hook Element. You will now be able to Check Execute PHP.

Thanks. That worked.

You're welcome

This archived topic is closed to new replies.