Appointments+ Calendar on Buddypress profile pages

I’m building a site that is designed to connect local students with tutors, and using Buddypress with A+. Each tutor has a profile, and is in one or more BP groups depending on the subjects they teach, and sets up a schedule.

I found a similar topic a while back, and tried the suggestions there, and it’s only partially working…

An “appointments” tab is visible, but only when looking at one’s own profile, which is great, as the tutor can manage their schedule.

What I’m hoping to achieve is having the calendar/schedule of a particular provider be visible to all visitors when they are on that providers profile page.

Preferably, this calendar would be below the base information, but in a “Schedule” tab would be fine too.

Here’s the code I have added…

In functions.php…

function my_setup_nav() {
global $appointments, $bp;
$a = $appointments;
if ( !is_object($a) || !$a->is_worker( bp_displayed_user_id() ) )

bp_core_new_subnav_item( array(
'name' => __( 'My Schedule', 'appointments' ),
'slug' => 'my-schedule',
'parent_url' => $bp->displayed_user->domain . 'appointments/',
'parent_slug' => 'appointments',
'screen_function' => 'tab_template_app_schedule'
) );

function tab_template_app_schedule() {
add_action( 'bp_template_content', 'screen_content_app_schedule' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );

function screen_content_app_schedule(){
echo do_shortcode( '[app_schedule worker="'.bp_displayed_user_id().'" logged=" " title="My Schedule from START to END"]' );
echo do_shortcode( '[app_pagination]' );

add_action( 'bp_setup_nav', 'my_setup_nav', 25 );

and in the footer.php…

<?php function add_app_scripts( $script ){
global $appointments;
$appointments->load_scripts_styles( );
return $script . $appointments->script;
add_filter( 'app_bp_footer_scripts', 'add_app_scripts' );?>