rtMedia js hooks

rtMedia has several js hooks defined which works like WordPress hooks, you can use them in your theme or plugin for rtMedia related tasks.

rtmedia_after_gallery_load

This will be called after rtMedia gallery load/refresh.

rtmedia_js_file_added

This will be called after file added in queue for upload (need to return true/false).

rtmedia_js_file_remove

This will be called after file removed from upload queue.

rtmedia_js_after_file_upload

This will be called after single file upload.

rtmedia_js_after_files_uploaded

This will be called after all the files uploaded.

rtmedia_js_after_comment_added

This will be called after comment added for media.

rtmedia_js_after_comment_deleted

This will be called after comment is deleted.

rtmedia_js_popup_after_content_added

This will be called after lightbox has been opened.

rtmedia_js_after_activity_added

This will be called after rtMedia activity added in BuddyPress activity page.

rtm_custom_progress_bar_content

This will be called when media is attached while uploading media. You can call this if you want to add your own custom content in progress bar.

To use rtMedia js hook, you need to register corresponding function to hook. Check below example for how to use rtMedia js hooks.

if( typeof rtMediaHook == "object" ){   // check if rtMediaHook defined or not
rtMediaHook.register(
'rtmedia_js_after_file_upload', // hook id here
function ( args ) { // your function here
// your code here
  }
);
}