Developers

Filters

rtmedia_media_uploader_attributes

Use this filter for allowing the users to select album while uploading media using rtMedia Uploader.

Here is the sample code to fetch albums of the context Profile.

add_filter( 'rtmedia_media_uploader_attributes', function( $attr ){
    global $rtmedia_query;        
    if ( $rtmedia_query->is_upload_shortcode ) {
        $rtmedia_query->query['context'] = 'profile';
    }
    return $attr;
}, 10, 1 );

If you want to fetch albums of the context Group then you can change the above code like this:

add_filter( 'rtmedia_media_uploader_attributes', function( $attr ){
    global $rtmedia_query;        
    if ( $rtmedia_query->is_upload_shortcode ) {
        $rtmedia_query->query['context'] = 'group';
    }
    return $attr;
}, 10, 1 );