Closed valivvvv closed 6 years ago
Of course that means that all someone has to do to enable the settings is change the theme . . . .
I ran into this issue, too.
Resulted in:
Fatal error: Call to undefined function add_filter()
When placing the code snippet from the documentation inside my theme's functions.php
file everything worked as described.
While I understand the ramifications of coupling this setting to my theme, as @orionrush mentioned, the documentation here is resulting in fatal errors.
Upon further investigation, it appears the correct documentation should instruct the developer to add,
define( 'ATTACHMENTS_SETTINGS_SCREEN', false );
before
require_once(ABSPATH . 'wp-settings.php');
inside wp_config.php
, which makes sense since the documentation asks the developer to use the add_filter
method which isn't defined until WordPress loads the plugin.php
file inside wp-settings.php
.
I tested this between multiple themes and it appears to resolve the issue.
This issue can be closed.
Check up your documentation here: https://github.com/jchristopher/attachments/blob/master/docs/usage.md#disable-settings-screen
add_filter( 'attachments_settings_screen', '__return_false' ); // disable the Settings screen
This should be added to functions.php, not wp-config.php, as currently stated.
Great plugin, cheers!