rtmedia_modify_activity_upload_url

Fix for BuddyPress multilingual plugin on activity pages.

Description

(array) rtmedia_modify_activity_upload_url( (array) $params ); 

Returns (array)

Parameters (1)

0. $params (array)
The params.

Usage

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

Defined (1)

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

/app/main/controllers/template/rtmedia-filters.php  
  1. function rtmedia_modify_activity_upload_url( $params ) { 
  2.  
  3. // return original params if BuddyPress multilingual plugin is not active 
  4. include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
  5.  
  6. if ( function_exists( 'is_plugin_active' ) && is_plugin_active( 'buddypress-multilingual/sitepress-bp.php' ) ) { 
  7. if ( class_exists( 'BuddyPress' ) ) { 
  8. // change upload url only if it's activity page and if it's group page than it shouldn't group media page 
  9. if ( bp_is_activity_component() || ( bp_is_groups_component() && ! is_rtmedia_page() ) ) { 
  10. if ( function_exists( 'bp_get_activity_directory_permalink' ) ) { 
  11. $params['url'] = bp_get_activity_directory_permalink() . 'upload/'; 
  12.  
  13. return $params; 
  14.