Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Enabling Media Trash via wp-config.php

         

JamesSC

2:19 am on Mar 10, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



Problem: I want to enable the trash option in the Media Library on WordPress 5.3.2
Universal suggestion: add

define( 'MEDIA_TRASH', true );


at the top of the wp-config.php file.

Done. Nothing. Nada. No media trash.

The wp-config file lies outside of root, as it has forever, and the site loads and functions flawlessly otherwise.

Changing permissions from 0640 through 0644 to 0660 has had no effect.

What could possibly be inhibiting this code in wp-config from activating the Media trash can as suggested?

I have nothing in .htaccess but standard file protection from external sources. I run a firewall plugin, but even deactivating it has had no effect.

Because WordPress must be reading everything in the wp-config file simply to load, the only two things I can conclude at this point are either that the code is wrong, or that WP 5.3.2 no longer accepts it for some reason.

not2easy

2:43 am on Mar 10, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I would expect that to be in the functions.php file in the theme (or child theme) folder, not in the config.php file which pretty much controls the paths to database, the passwords and table prefixes - the backend setup, not the UI you would see.

At the top of one old config file it shows
This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH.
it really is not involved with optional features.

PS - Be sure to keep your wp-config.php file under tight permissions.

JamesSC

3:47 am on Mar 10, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



Thanks, Not; I agree 100%. That's where I have always made such changes.

On the other hand, every reference I have been able to surface, including from media-whatever plugin authors, has explicitly quoted placing that exact code string at the top of wp-config.php and nowhere else, and nothing else.

Worse for me, apparently others have followed that advice and succeeded where I have so far failed. There have been no ambiguous sorta-but-not entirely successful situations, nor any references at all I've been able to find to any functions file or any other alternative routes to enabling a Media Library trash option.

not2easy

3:54 am on Mar 10, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I used to be able to find so much more information in the WP codex files for this kind of thing, but it appears they don't have the same structure as before and I keep getting 403s at old bookmarks. It may still be out there, I haven't had an urgent need to try to find out what they did with the old codex files.

JamesSC

5:05 am on Mar 10, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



Ha! It turns out sometimes just whaling on things with a hammer until they yield is the most elegant approach.

Not, it turns out that wp-config.php already contains a number of other define statements.

The trick here ultimately turned out to be setting define to false, saving the file, setting it back to true, re-saving the file, whereupon - voila! - a Media Library trash can.

Sometimes code really is poetry - Vogon poetry.