/**
  * Helper function to check whether the shortcode should be rendered or not
  *
  * @return type
  */
 static function display_allowed()
 {
     global $rtmedia_query;
     $flag = !(is_home() || is_post_type_archive() || is_author()) && is_user_logged_in() && (is_rtmedia_upload_music_enabled() || is_rtmedia_upload_photo_enabled() || is_rtmedia_upload_video_enabled()) && (isset($rtmedia_query->is_upload_shortcode) && $rtmedia_query->is_upload_shortcode == true || is_rtmedia_bp_profile() && is_rtmedia_profile_media_enable() || is_rtmedia_bp_group() && is_rtmedia_group_media_enable());
     $flag = apply_filters('before_rtmedia_uploader_display', $flag);
     return $flag;
 }
 function add_nav()
 {
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     if (!is_rtmedia_profile_media_enable()) {
         return;
     }
     if (!is_rtmedia_privacy_enable()) {
         return;
     }
     if (!is_rtmedia_privacy_user_overide()) {
         return;
     }
     $settings_link = trailingslashit($user_domain . 'settings');
     $defaults = array('name' => $this->title(), 'slug' => 'privacy', 'parent_slug' => 'settings', 'parent_url' => $settings_link, 'item_css_id' => 'rtmedia-privacy-settings', 'user_has_access' => true, 'site_admin_only' => false, 'position' => 80, 'screen_function' => array($this, 'settings_ui'), 'link' => '');
     bp_core_new_subnav_item($defaults);
 }
function rtm_is_buddypress_enable($flag)
{
    global $rtmedia_query;
    if (isset($rtmedia_query->query) && isset($rtmedia_query->query['context']) && $rtmedia_query->query['context'] == "group" && is_rtmedia_group_media_enable()) {
        return $flag;
    } else {
        if (isset($rtmedia_query->query) && isset($rtmedia_query->query['context']) && $rtmedia_query->query['context'] == "profile" && is_rtmedia_profile_media_enable()) {
            return $flag;
        }
    }
    return false;
}