Skip to content

rtMedia Integration

BuddyX Pro includes a compatibility layer for rtMedia. It does two things: it re-renders the rtMedia media screens inside BuddyX Pro’s own page structure, and it adjusts the image URL used for photos in the activity stream. The page-structure half only applies when your BuddyPress template pack is BP Nouveau. This page covers both, plus what the theme does not do.


rtMedia is a plugin that adds photo, video, audio and document uploads to BuddyPress. Members get media tabs on their profiles, groups get a media tab, and uploads appear in the activity stream.

BuddyX Pro does not add media features. The uploading, albums, privacy and playback all come from rtMedia. What the theme adds is presentation: on BP Nouveau the rtMedia screen is wrapped in BuddyX Pro containers and the member or group wrapper picks up the iconic navigation class. On the legacy template pack the theme’s override runs but outputs rtMedia’s own BuddyPress markup with none of those wrappers.


Requirement Notes
rtMedia plugin Required. The theme loads its rtMedia compatibility file only when the RTMedia class exists.
BuddyPress Required by rtMedia itself, and by the activity filter described below.
BuddyX Pro theme Active. There is nothing to switch on.

The integration is entirely conditional. With rtMedia deactivated, none of this code runs.


  1. Go to Plugins > Add New
  2. Search for “rtMedia”
  3. Click Install Now, then Activate

The theme picks the integration up automatically on the next page load. There is no theme setting to enable.

On BP Nouveau, the rtMedia screen reads the same navigation style settings the rest of your community uses. Only the iconic value is acted on there: the swipe variants produce no class on media screens, so they render like Default.

For member media screens:

  1. Go to Appearance > Customize
  2. Open Community Settings > Single Member
  3. Set Single Member Navigation Style
  4. Click Publish

For group media screens:

  1. Go to Appearance > Customize
  2. Open Community Settings > Single Group
  3. Set Single Group Navigation Style
  4. Click Publish

The theme’s rtMedia template branches on which BuddyPress template pack your site uses. It reads the _bp_theme_package_id option and takes one path for BP Nouveau and another for the legacy pack. The two are not equivalent: only the Nouveau branch prints the theme’s .container / .site-wrapper / .bp-wrap shell and the nav-style class. The legacy branch prints rtMedia’s own BuddyPress markup inside #buddypress and nothing more. If you switch BuddyPress template packs, open a member media tab and a group media tab afterwards to confirm the layout still looks right.


Capability What actually happens
Media screens match the rest of the theme on BP Nouveau The theme ships its own rtmedia/main.php. On the Nouveau branch it re-renders the rtMedia screen inside BuddyX Pro containers.
Member and group nav on media screens (BP Nouveau) The Nouveau branch adds buddyx-nav-iconic to the member or group wrapper when your nav style is iconic.
Both BuddyPress template packs render Separate branches for BP Nouveau and the legacy pack. Only the Nouveau branch adds theme containers and the nav-style class.
Photo URL adjustment in the activity stream A filter swaps the image URL on photo media items in the activity component and on group pages.

The theme does not add albums, privacy controls, upload limits, media types, or a media widget. All of that stays with rtMedia.


The theme ships its own rtmedia/main.php at the theme root, replacing the rtMedia main template.

What the override does on every template pack:

  • Wraps everything in a #buddypress element, so BuddyPress and BuddyX Pro styling both apply
  • Reads the _bp_theme_package_id option and branches between a BP Nouveau path and a legacy path
  • Branches again between member context and group context

What only the BP Nouveau branch does:

  • Outputs the theme’s own containers: .container, .site-wrapper and .bp-wrap around #item-body
  • Adds buddyx-nav-iconic to the .site-wrapper element when the nav style is iconic

The practical effect on BP Nouveau is that the media tab sits inside the same shell as the activity tab or the members directory, rather than in rtMedia’s own bare markup. On the legacy pack the branch emits #item-body and rtMedia’s own item-header / item-nav markup, without the theme shell.

Inside the BP Nouveau branch of rtmedia/main.php the member path reads buddypress_single_member_nav_style and the group path reads buddypress_single_group_nav_style. Both fall back to iconic, which is also the Customizer default, and iconic adds the class buddyx-nav-iconic to the .site-wrapper element (member-home or group-home).

Two divergences from the regular community screens:

  • The template tests for iconic only. iconic_swipe1 and iconic_swipe2 fall to an empty class here, so media screens render them like Default. buddypress/members/single/home.php and buddypress/groups/single/home.php map all three values.
  • The legacy template-pack branch does not read either theme mod at all.

The theme attaches one function, buddyx_custom_rtmedia_filter(), to rtMedia’s own rtmedia_single_activity_filter hook at priority 10.

It only does anything when all three of these are true:

  1. The buddyx_rtmedia_filter_enabled filter returns something truthy. It defaults to true.
  2. The media item’s type is photo. Video, audio and documents are left alone.
  3. The current screen is the activity component, or a group page.

If any one of those is false, the activity HTML is returned unchanged.

When all three are true, the function asks WordPress for the attachment URL at the image size custom_rtmedia_size and, if it gets one back, rewrites the src attribute in the activity item markup to point at it.

Two behaviours are worth stating plainly, because they change what you actually see:

  • custom_rtmedia_size is not a size the theme registers. The theme registers buddyxpro-featured, buddyxpro-large, buddyxpro-list, buddyxpro-col-two and buddyxpro-col-three. Asking wp_get_attachment_image_src() for a size that is not registered returns the full-size image, so on a stock install this filter resolves to the full-size URL.
  • The rewrite is a regular expression over the whole activity item HTML with no match limit, so it replaces every src attribute in that markup, not only the media image.

If either of those is a problem on your site, turn the filter off. See the developer section below.


There is no rtMedia settings panel in the Customizer, and no on/off switch for the activity filter in the admin. Two existing theme settings do affect the rtMedia screen.

Location: Appearance > Customize > Community Settings > Single Member

Sets the navigation style used on member screens. On the rtMedia media tab only iconic has an effect, and only on BP Nouveau.

Default: iconic

Options: Default, Icon + Label (iconic), Icon + Label (Swipe 1), Icon + Label (Swipe 2).

Location: Appearance > Customize > Community Settings > Single Group

Sets the navigation style used on group screens. On the group media tab only iconic has an effect, and only on BP Nouveau.

Default: iconic

Options: Default, Icon + Label (iconic), Icon + Label (Swipe 1), Icon + Label (Swipe 2).

Not a Customizer setting. This is a code-level filter that gates the activity stream photo filter.

Default: true

There is no admin control for it. A site owner who wants it off needs a snippet in a child theme or a small plugin, shown below.


Members post pictures to the activity stream all day, so the media tab is one of the most visited screens on the site. On BP Nouveau, the theme’s rtmedia/main.php override keeps that tab in the same header, navigation and container widths as the activity tab, instead of dropping visitors into differently-shaped markup halfway through a browsing session. Set your Single Member Navigation Style to Icon + Label and the media tab picks up the same iconic nav class.

Each group gets a media tab. The theme’s override has a dedicated group branch, so on BP Nouveau group media screens get the group wrapper and the group nav class rather than a member-style one. If you switch to the legacy template pack during a redesign, budget time to re-check the media tab: the legacy branch renders without the theme’s container shell.

A course site where students submit work as images

Section titled “A course site where students submit work as images”

Students upload screenshots to a group activity stream. Because the theme’s activity photo filter resolves to the full-size image on a stock install, submissions display at full resolution in the stream. If you would rather serve a smaller file to keep the stream fast, register custom_rtmedia_size in a child theme so the filter has a real size to hand back.

The photo filter applies only in the activity component and on group pages, and only to photo media. If full-size images in the stream are costing you bandwidth, the fastest fix is one line in a child theme to return false from buddyx_rtmedia_filter_enabled, which leaves rtMedia’s own URLs in place.


Media Tab Does Not Match the Rest of the Site

Section titled “Media Tab Does Not Match the Rest of the Site”

Problem: The rtMedia screen looks unstyled or differently shaped.

Checks:

  1. Confirm rtMedia is active. The theme’s compatibility file loads only when the RTMedia class exists.
  2. Confirm no plugin or child theme is supplying its own rtmedia/main.php. The last override to be found wins.
  3. Confirm your BuddyPress template pack is BP Nouveau. On the legacy pack the theme’s container shell is not printed, so the screen legitimately looks different.
Section titled “Navigation Style Not Applied on the Media Tab”

Problem: The media tab navigation looks different from other tabs.

Checks: the media tab honours only the iconic value, and only on BP Nouveau. If your nav style is a Swipe variant, or your template pack is the legacy one, the media tab has no nav-style class by design.

Fix:

  1. Go to Appearance > Customize > Community Settings > Single Member for member screens, or Single Group for group screens
  2. Set the navigation style to Icon + Label
  3. Click Publish
  4. Clear any page cache and reload the media tab

Problem: Photos in the activity stream load at full size.

Cause: The filter requests the image size custom_rtmedia_size, which is not registered by the theme. An unregistered size resolves to the full-size image.

Fix: Either register custom_rtmedia_size in a child theme so the filter has a real size to return, or disable the filter. Both snippets are in the developer section.

The Wrong Image Is Replaced in an Activity Item

Section titled “The Wrong Image Is Replaced in an Activity Item”

Problem: An avatar or another image inside an activity item has been swapped for the media photo.

Cause: The rewrite is a regular expression over the activity item HTML with no match limit, so every src attribute in that markup is replaced.

Fix: Return false from buddyx_rtmedia_filter_enabled to leave rtMedia’s original URLs alone.

Problem: Activity photo URLs are unchanged.

Checks:

  1. The media item must be of type photo. Video, audio and documents are skipped.
  2. The screen must be the activity component or a group page. On a member profile media tab, for example, the filter does not run.
  3. buddyx_rtmedia_filter_enabled must not have been filtered to false anywhere.

The compatibility file is required in functions.php behind a class_exists( 'RTMedia' ) check, so nothing in inc/compatibility/rtmedia/ is parsed when rtMedia is inactive.

Filter Defined in Default Purpose
buddyx_rtmedia_filter_enabled inc/compatibility/rtmedia/rtmedia-functions.php true Gates buddyx_custom_rtmedia_filter(). Return false to leave activity markup untouched.

The theme’s own consumer of rtMedia’s hook:

Hook Owner Callback Priority / args
rtmedia_single_activity_filter rtMedia plugin buddyx_custom_rtmedia_filter() 10 / 2
add_filter( 'buddyx_rtmedia_filter_enabled', '__return_false' );

The filter asks for custom_rtmedia_size, which no code in the theme registers. Register it yourself if you want a sized image rather than the full-size one:

add_action( 'after_setup_theme', function () {
add_image_size( 'custom_rtmedia_size', 800, 800, false );
}, 20 );

Existing uploads need regenerating before the new size exists for them.

inc/Post_Thumbnails/Component.php registers buddyxpro-featured, buddyxpro-large, buddyxpro-list, buddyxpro-col-two and buddyxpro-col-three. inc/Image_Sizes/Component.php registers no sizes of its own; it only adds filters.

Path Role
rtmedia/main.php Full override of the rtMedia main template. Wraps the screen in #buddypress, branches on _bp_theme_package_id and on member versus group context. Prints the theme containers on the BP Nouveau branch only.

To change the rtMedia screen structure, copy rtmedia/main.php into your child theme and edit it there.

Read in the BP Nouveau branch only. The legacy branch reads neither.

Theme mod Fallback used in rtmedia/main.php Values honoured
buddypress_single_member_nav_style iconic iconic only
buddypress_single_group_nav_style iconic iconic only

#buddypress and #item-body on both template packs. .container, .site-wrapper (with member-home or group-home), .bp-wrap, and .buddyx-nav-iconic when the nav style is iconic, on the BP Nouveau branch only.



Got a question? We’re a friendly team - happy to help.

Documentation: buddyxtheme.com/docs Support Forum: wbcomdesigns.com/support

Email Support: support@wbcomdesigns.com

Include: BuddyX Pro version, rtMedia version, your BuddyPress template pack, and a screenshot of the screen in question.