dunkydoodle
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Conversion Tracking] Bug: Version 2.0.6That worked for me, thank you!
ok, this worked for me: https://wpsnipp.com/index.php/functions-php/restricting-users-to-view-only-media-library-items-they-upload/
– this allows the current user to only see photos they have uploaded to the media library.
there are also ways to hid the library entirely if you google it.
Forum: Fixing WordPress
In reply to: Hiding images in the media libraryi have a similar concern: I’ve added upload_files capability to subscribers so they can upload an avatar, but now that grants them access to the media library which I don’t want. Wish there was a way to upload a photo without using wordpress’ media uploader / library.
ok, I got it to work by changing this: add_action( ‘admin_init’, ‘add_theme_caps’);
to
add_action( ‘init’, ‘add_theme_caps’);
I also only needed to add the one ‘upload_files’ cap; however, now subscribers have access to the media library which is not what I want.
here’s code I’m using, still not working.
function add_theme_caps() {
$subscriber = get_role( ‘subscriber’ ); // I also tried ‘Subscriber’
$caps = array( ‘upload_files’, ‘edit_posts’, ‘edit_published_posts’, ‘delete_posts’, ‘delete_published_posts’, ‘publish_posts’ );
foreach( $caps as $cap ) {
$subscriber->add_cap( $cap );
}
}add_action( ‘admin_init’, ‘add_theme_caps’);
I have the same issue: the avatar upload button doesn’t work for subscribers, but only for authors and up. I could change roles to authors, except I don’t want to grant access to the media library. I have also tried to add_cap(‘upload_files’) to the subscriber role, but that doesn’t work either. I will continue to try adding more caps per your recommendation, but I’m not sure why adding editing posts, etc would affect just this media upload issue, and again, I don’t want to allow subscribers to see the media library.
Forum: Plugins
In reply to: [Plugin: WordTwit] MySQL query broken (fix included)holy f’n crap! that fixed things for me. thanks.