The Uploader shortcode gives you a way to add the rtMedia Anywhere Uploader to any Post, Page or CPT.
The simplest way to use this shortcode is as follows:
[rtmedia_uploader]
The above shortcode can be extended via a set of parameters specified on this page. Each of these parameters are available with rtMedia Core.
To get an a general idea of how to use the Gallery shortcode, have a look at some common use cases at the end of this page.
Parameters
context
Every media file has an associated context
value associated with it. This value usually refers to the location where the media was uploaded. When using the rtMedia Uploader shortcode, this value can be set to any standard / custom value.
Read more about context in this doc.
Accepted values:
context | Notes | |
---|---|---|
WordPress | post | |
page | ||
BuddyPress | profile | Set for uploads from the site-wide & personal Activity Feeds as well as “Media” tab |
group | Set for uploads from BP Group Feed and “Media” tab | |
bbPress | topic | Set when media is uploaded while creating a forum topic |
reply | Set when media is uploaded with a reply to a forum topic | |
rtMedia | NULL | Set for Global Albums created with rtMedia Default Albums |
dashboard | Set for media uploaded to a rtMedia WordPress Sitewide Gallery | |
comment | Set for media attached to a WordPress comment via rtMedia WordPress Comment Attachments | |
comment-media | Set for media attached via the Comment Media feature |
Note that the above values can be applied to media on a vanilla installation of WordPress + BuddyPress + rtMedia. Custom post types can apply different values.
Default / fallback value:
If the context
is not provided, the uploader assumes the current post type as the context.
context_id
Every media file has a context_id
value associated with it. This value, along with the context
help identify where the media was uploaded from.
Please refer to this doc if you are not sure how to find the context ID of a media file.
Accepted values:
Any numerical value corresponding to an existing context
Default / fallback value:
If not specified, the current page/post’s context_id
will be set as the media’s context_id
album_id
Specify a particular album that media will be uploaded to.
Please refer to this doc if you are not sure how to find the album ID of an album.
Accepted values:
Any numerical value corresponding to an existing context
Default / fallback value:
If not specified, the current context_id
will be set as the media’s album_id
privacy
Sets the privacy level of the uploaded file. rtMedia supports four levels of Privacy by default:
If this parameter is not set, the default site-wide privacy will be used.
Accepted values:
Numerical values representing the different rtMedia default privacy levels are accepted.
- 20 (Logged in users)
- 40 (Friends)
- 60 (Private)
- 80 (Moderated media, requires rtMedia Moderation)
- 0 (Public)
Default / fallback value:
media_type
The Uploader shortcode will accept any default file type by default. You can change this behavior by using the media_type
parameter.
Accepted values:
Any combination of the following values will be accepted:
- photo
- video
- music
- document (requires rtMedia Docs and Other files)
- other (requires rtMedia Docs and Other files)
Default / fallback value:
None
Common use cases
Upload media to the specific album id ( Default Album ).
[rtmedia_uploader album_id=125]
Upload media to a BuddyPress group ( group_id #1 ) under album id #48. [rtmedia_uploader context=group context_id=1 album_id=48]
Upload media to a page ( page_id #11 ). [rtmedia_uploader context=page context_id=11 album_id=1]
Upload media ( only photos ) with privacy level. [rtmedia_uploader album_id=1 privacy=20 media_type=photo]
Note: Default rtMedia privacy levels and their values are as follow : 1. Public : 0 2. Logged in user : 20 3. Friends : 40 4. Private : 60
This privacy levels will have their effect to uploader shortcode only if ‘Allow users to set privacy for their content’ option from Privacy tab is set to ON under rtMedia admin settings otherwise, the privacy you are setting with the uploader ShortCode page ( or with any post ), will be overridden by the default privacy set under ‘Privacy Settings’.
Developers
The rtmedia_media_uploader_attributes
filter allows users to select which album they want uploaded media to be added to. Read more on this page.