BP_XProfile_Component::late_includes()

Late includes method.


Description Description

Only load up certain code when on specific pages.


Source Source

File: bp-xprofile/classes/class-bp-xprofile-component.php

	public function late_includes() {
		// Bail if PHPUnit is running.
		if ( defined( 'BP_TESTS_DIR' ) ) {
			return;
		}

		// Bail if not on a user page.
		if ( ! bp_is_user() ) {
			return;
		}

		// User nav.
		if ( bp_is_profile_component() ) {
			require $this->path . 'bp-xprofile/screens/public.php';

			// Sub-nav items.
			if ( is_user_logged_in() && 'edit' === bp_current_action() ) {
				require $this->path . 'bp-xprofile/screens/edit.php';
			}
		}

		// Settings.
		if ( is_user_logged_in() && bp_is_user_settings_profile() ) {
			require $this->path . 'bp-xprofile/screens/settings-profile.php';
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.