Consider the following problem:
100,000 images have been added by members into the MediaPress system.
Now, when ADMINS have the task of uploading images, or, browsing the WordPress media library they must sort through MediaPress user uploads and separate them from Admin WordPress uploads.Solution – idea:
1- Is there a way to keep MediaPress->Image uploads out of the WordPress->Media Library?
2- Is there a way to stop MediaPress->Images from showing up in the “Add Media” button/action when editing a Page or a Post?Ideally: the concept here would be to quarantine ALL “non admin” user uploaded MediaPress content into its own area.
For example:
WordPress Media Area => /wp-admin/upload.php
* No MediaPress images should show up hereMediaPress Gallery Area =>/wp-admin/edit.php?post_type=mpp-gallery
* This is fine MediaPress->All GalleriesNEW MediaPress “Media Area” =>/wp-admin/edit.php?post_type=mpp-images
* New area where all MediaPress images would reside, far away from the WordPress Core
* New Menu item needed here: MediaPress->LibraryAdmin Page/Post editing:
/wp-admin/post-new.php?post_type=post
/wp-admin/post-new.php?post_type=page
Click on “Add Media”
=> No MediaPress items should show up here
* only Admin uploaded content such as logos, graphics and branding materials should show hereAny ideas on how to accomplish this easily with a hook or a custom page?
Hi Christian,
Thank you for the question.
Both are doable. We left it this way to allow admins see what users are doing on their site. I will add an option in next version to toggle the visibility from the media manager.Regards
BrajeshAwesome. Thank you!
Could you tell us what PHP code is needed here in the forum and explain a bit?
Maybe just a few functions/actions/hooks so we can get started within our theme to fix the issue at hand.- This reply was modified 5 years, 5 months ago by Christian W Zagarskas.
Hi Christian,
I am sorry I am replying late.Please put this in your bp-custom.php
/** * Filter WordPress attachment args to remove MediaPress Media from the list. * * @param array $args args. * * @return array */ function mpp_custom_filter_attachment_args( $args ) { $args['meta_key'] = '_mpp_is_mpp_media'; $args['meta_compare'] = 'NOT EXISTS'; return $args; } add_filter( 'ajax_query_attachments_args', 'mpp_custom_filter_attachment_args' );
That will do it.
Regards
BrajeshThat worked great!
Thank you, excellent.
It is now much easier for us to find our company media.Is there a way to move the images
out of the “WP->Media->Library”
and into a new page called “Media Press->Media->Uploads”?Hi Christian,
Thank you for confirming.About listing images. Since you have removed them from the WordPress media list, you will need to manage them via MediaPress->All Galleries and going to individual gallery.
It is possible to add a page to list/manage all media in one place but it is not in our development goals.
Thank you
BrajeshI wondered about this same thing… Especially since admins don’t know whether they can use that media on the public part of the website.
I tried adding this code to bp_custom.php but is it retroactive? I still see all of the MediaPress images in my WordPress Media Library.
Help?
Please name the file bp-custom.php
For more details, Please see
https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/Regards
BrajeshYes, I already have a bp_custom.php that I’m using in /wp-content/plugins. I added the code but see no change in my Media Library.
Yes, sorry. Typo. It IS bp-custom.php (not underline). All my other code snippets in that file are working fine. Just not this one.
You must be logged in to reply to this topic.