tomusborne / generatepress

452 stars 89 forks source link

Constant DISALLOW_FILE_EDIT set to false prevents php execution in Elements #589

Closed seamofreality closed 4 months ago

seamofreality commented 11 months ago

Description

This is regarding GeneratePress Version 3.3.1

We've had php execution enabled in our custom theme elements defined via "Elements". The plugin "Defender" added a line define( 'DISALLOW_FILE_EDIT', false ); in the wp-config.php which led to all the snippets containing php being broken. Custom elements showed a hint: "Unable to execute PHP as DISALLOW_FILE_EDIT is defined."

Screenshot_2023-12-29_081025@2x

Steps to reproduce

  1. Add define( 'DISALLOW_FILE_EDIT', false ); to your wp-config.php

OR

  1. Activate Defender plugin
  2. Store normal settings with "Disable the file editor" inactive

Actual behavior

DISALLOW_FILE_EDIT set to false disables php execution.

Expected behavior

DISALLOW_FILE_EDIT set to false should not disable php execution, only if it's set to true.


References

Screenshot_2023-12-29_081219@2x

tomusborne commented 4 months ago

This will be fixed in GPP 2.5.0.

Thanks!