Tagged: default album, shortcode
Hi
Is it possible to get rid of the function ‘please select gallery’ on the shortcoded uploader and the user will just upload to the default album?
I have set up a default album using your code from here:
https://buddydev.com/support/forums/topic/mediapress-predefined-user-galleries/
So the user only has one album they can upload to.
Thanks
Jem
Hi Jem,
Thank you for asking. Since you are using the code from the linked topic, It is easy.In that thread, I had stored the gallery_id in a meta like this
update_user_meta( $user_id, '_mpp_predefined_gallery_photo_1', $gallery_id ); //you can change the key to anything
So, All we need to do here is reuse this gallery id like this
<?php if ( bp_is_my_profile() ) : $gallery_id = get_user_meta( bp_loggedin_user_id(), '_mpp_predefined_gallery_photo_1', 'true' );//please change the key to the one you re using ?> <?php echo do_shortcode("[mpp-uploader gallery_id=". $gallery_id ." ]");?> <?php endif;?>
Please make sure to use the correct key that you had stored in the usermeta.
Please do let me know if that works fro you or not?
Thank you
Brajesh
You must be logged in to reply to this topic.