Reports::init()

Add actions once integration is ready

Description

Source

File: bp-integrations/learndash/buddypress/Reports.php

	public function init()
	{
		add_action('bp_enqueue_scripts', [$this, 'registerReportsScript']);

		// add plugable templates to report actions
		add_action('bp_ld_sync/reports', [$this, 'showReportFilters'], 10);
		add_action('bp_ld_sync/reports', [$this, 'showReportUserStats'], 20);
		add_action('bp_ld_sync/reports', [$this, 'showReportCourseStats'], 20);
		add_action('bp_ld_sync/reports', [$this, 'showReportTables'], 30);
		add_action('bp_ld_sync/reports', [$this, 'showReportExport'], 40);

		add_filter('bp_ld_sync/reports_generator_params', [$this, 'forceOwnReportResults'], 99);
		add_filter('bp_ld_sync/reports_generator_params', [$this, 'courseReportResults'], 99);

		add_filter('bp_ld_sync/report_filters', [$this, 'removeCourseFilterIfOnlyOne']);
		add_filter('bp_ld_sync/report_filters', [$this, 'removeUserFilterIfStudent']);

		add_filter('learndash_user_activity_query_fields', [$this, 'reportAdditionalActivityFields'], 10, 2);
		add_filter('learndash_user_activity_query_tables', [$this, 'reportAdditionalActivityTables'], 10, 2);
		add_filter('learndash_user_activity_query_where', [$this, 'reportAdditionalActivityWheres'], 10, 2);
		add_filter('learndash_user_activity_query_where', [$this, 'reportAdditionalActivityGroups'], 15, 2);

		add_filter('bp_ld_sync/report_columns', [$this, 'removeUserColumnIfSelected'], 10, 2);
		add_filter('bp_ld_sync/report_columns', [$this, 'removeCourseColumnIfSelected'], 10, 2);
		add_filter('bp_ld_sync/report_columns', [$this, 'removePointsColumnIfNotAssigned'], 10, 2);

		add_action( 'bp_ld_sync/export_report_column', [ $this, 'export_report_column' ], 10, 2 );
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.