Developer Guide
Developer Guide
Section titled “Developer Guide”BuddyPress Schedule Activity is a lean plugin that hooks into BuddyPress and BuddyBoss to give members the ability to post activities on a future date. This guide covers the technical contracts developers should know: hooks, activity meta, the cron publish loop, and AJAX endpoints.
Requirements
Section titled “Requirements”| Requirement | Minimum |
|---|---|
| WordPress | 5.0 |
| BuddyPress | 6.0 or BuddyBoss Platform (any version) |
| PHP | 7.4 |
Plugin Initialization
Section titled “Plugin Initialization”The plugin bootstrap runs on plugins_loaded at priority 10:
add_action( 'plugins_loaded', 'run_buddypress_schedule_activity', 10 );Inside run_buddypress_schedule_activity() there is an explicit BuddyPress guard:
function run_buddypress_schedule_activity() { if ( class_exists( 'Buddypress' ) ) { $plugin = new Buddypress_Schedule_Activity(); $plugin->run(); }}The class name checked is Buddypress (capital B, no trailing ‘s’). This is the BuddyPress core class. If BuddyPress or BuddyBoss Platform is not active, the plugin’s classes and hooks are never registered. Any code that integrates with this plugin should check for class_exists( 'Buddypress' ) or confirm that BUDDYPRESS_SCHEDULE_ACTIVITY_VERSION is defined before accessing the plugin’s functionality.
File Structure
Section titled “File Structure”buddypress-schedule-activity/├── buddypress-schedule-activity.php # Bootstrap + global helpers├── includes/│ ├── class-buddypress-schedule-activity.php # Core class — wires all hooks│ ├── class-buddypress-schedule-activity-loader.php # Hook registration queue│ ├── class-buddypress-schedule-activity-activator.php│ ├── class-buddypress-schedule-activity-deactivator.php│ └── class-buddypress-schedule-activity-i18n.php├── public/│ ├── class-buddypress-schedule-activity-public.php # All frontend logic│ ├── js/buddypress-schedule-activity-public.js # Scheduling UI + AJAX│ └── css/ # Frontend styles├── admin/│ ├── class-buddypress-schedule-activity-admin.php # Asset enqueue only│ └── wbcom/ # License + settings wrapper├── edd-license/ # EDD license management└── languages/ # Translation files (.pot)Scheduling Flow
Section titled “Scheduling Flow”User fills in date/time inside the scheduling modal, clicks "Next" └── JS validates: date must be future; cannot exceed 90 days ahead └── bp_schedule_activity_type hidden input set to "scheduled" └── Submit button label changes to "Schedule" (bpsa_ajax_object.button_schedule_text)
BuddyPress posts the activity via post_update AJAX action └── bp_activity_posted_update fires (priority 9999) └── buddypress_schedule_activity_posted_update() ├── Validates nonce (action: buddypress-schedule-activity) ├── Verifies current user owns the activity ├── Validates date format (YYYY-MM-DD), time format (H:MM), meridiem (am/pm) ├── Converts 12-hour time to 24-hour ├── Writes scheduled datetime to bp_activity.date_recorded └── Sets bp_activity_meta: _bp_activity_status = 'scheduled'
WordPress Cron fires every minute (buddypress_schedule_activity_publish) └── buddypress_check_schedule_activity_publish() ├── Acquires transient lock (bpsa_publish_lock, 60 s TTL) ├── Queries: date_recorded <= NOW AND _bp_activity_status = 'scheduled' ├── Atomically updates meta to 'publishing' (prevents duplicate processing) ├── Deletes _bp_activity_status meta (activity becomes visible) ├── Resets date_recorded to current_time (shows as "posted now") └── Releases transient lockCompatibility Notes
Section titled “Compatibility Notes”Youzify
Section titled “Youzify”When the Youzify plugin is active, the scheduling icon is moved from bp_activity_post_form_options to bp_activity_post_form_tools. A Youzify-specific meta key (_bp_schedule_activity_title_for_youzify) is written so that the activity action string reads “posted an update” rather than Youzify’s default.
BuddyBoss Platform
Section titled “BuddyBoss Platform”BuddyBoss receives the scheduling modal HTML separately via bp_activity_post_form_options at priority 999. The toolbar icon is dynamically repositioned into the BuddyBoss “what’s new” toolbar on focus. The count badge on the navigation tab is omitted because BuddyBoss strips <span> tags from nav labels.
RTMedia
Section titled “RTMedia”When RTMedia is active and its privacy feature is enabled, the plugin switches from meta_query filtering to WHERE-clause filtering on bp_activity_meta to exclude scheduled activities from feeds. This also corrects the “Load More” button behavior for the scheduled posts tab.
Reign Theme / BuddyxPro
Section titled “Reign Theme / BuddyxPro”When Reign theme (REIGN_Theme_Class) is active, the bp_core_time_since filter is applied instead of bp_activity_time_since to render the “Scheduled for: Date” label correctly.

