add_upload_button

Add upload button.

Description

add_upload_button(); 

Usage

  1. if ( !function_exists( 'add_upload_button' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'rtmedia-for-wordpress-buddypress-and-bbpress/app/main/controllers/template/rtmedia-actions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = add_upload_button(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/app/main/controllers/template/rtmedia-actions.php  
  1. function add_upload_button() { 
  2. if ( function_exists( 'bp_is_blog_page' ) && ! bp_is_blog_page() ) { 
  3. /** 
  4. * Add filter to transfer "Upload" string,  
  5. * issue: http://git.rtcamp.com/rtmedia/rtMedia/issues/133 
  6. * By: Yahil 
  7. */ 
  8. $upload_string = apply_filters( 'rtmedia_upload_button_string', __( 'Upload', 'buddypress-media' ) ); 
  9.  
  10. if ( function_exists( 'bp_is_user' ) && bp_is_user() && function_exists( 'bp_displayed_user_id' ) && bp_displayed_user_id() === get_current_user_id() ) { 
  11. echo '<span class="primary rtmedia-upload-media-link" id="rtm_show_upload_ui" title="' . apply_filters( 'rtm_gallery_upload_title_label', __( 'Upload Media', 'buddypress-media' ) ) . '"><i class="dashicons dashicons-upload rtmicon"></i>' . apply_filters( 'rtm_gallery_upload_label', __( 'Upload', 'buddypress-media' ) ) . '</span>'; 
  12. } else { 
  13. if ( function_exists( 'bp_is_group' ) && bp_is_group() ) { 
  14. echo '<span class="rtmedia-upload-media-link primary" id="rtm_show_upload_ui" title="' . apply_filters( 'rtm_gallery_upload_title_label', __( 'Upload Media', 'buddypress-media' ) ) . '"><i class="dashicons dashicons-upload rtmicon"></i>' . apply_filters( 'rtm_gallery_upload_label', __( 'Upload', 'buddypress-media' ) ) . '</span>';