Thanks again for your help @colabsadmin. I think I’m getting closer but I’m quite new to learning how to use functions/actions properly
I thought I had it working (the Featured image was actually set) with the following code:
//Set uploaded media as cover photo after upload
function set_featured_after_upload ( $media_id, $file_object, $uploaded ) {
global $bp;
update_user_meta ( bp_loggedin_user_id(), 'rtmedia_featured_media', $media_id[0] );
}
add_action( 'rtmedia_after_add_media', 'set_featured_after_upload' );
// Show the tab content
function bp_custom_screen_content() {
rtmedia_uploader();
set_featured_after_upload();
}
That seemed to worked (besides showing some warnings) but as soon as I would move to another page the Featured image would be unset again.
So I figured you did not put the if_current_action check for nothing… so I added that back. As soon as I did that nothing happens after upload. I do get the following errors on both occasions:
Warning: Missing argument 1 for set_featured_after_upload(), called in custom.php on line 187 and defined in custom.php on line 176
I’ve updated my broken code in the gist…
I’ll now try and figure out if maybe there is a different $bp->current_action I need to use… Seems like the problem lies somewhere there