bp_duplicate_notice()

Displays an admin notice when BuddyPress plugin is active.

Description

Return

(void)

Source

File: bp-loader.php

	function bp_duplicate_notice() {

		if ( ! current_user_can( 'activate_plugins' ) ) {
			return;
		}


		global $incompatible_plugins;
		global $bp_plugin_file;
		global $bb_plugin_file;
		global $sitewide_plugins;
		global $is_bp_active;
		global $is_bb_active;
		global $plugins;

		// Disable BuddyPress message
		if ( $is_bp_active ) {
			if ( is_multisite() && ( is_network_admin() && ! in_array( $bp_plugin_file, $sitewide_plugins ) || in_array( $bp_plugin_file, $plugins ) ) ) {
				return;
			}
			$plugins_url  = is_network_admin() ? network_admin_url( 'plugins.php' ) : admin_url( 'plugins.php' );
			$link_plugins = sprintf( "<a href='%s'>%s</a>", $plugins_url, __( 'deactivate', 'buddyboss' ) );
			?>

            <div id="message" class="error notice">
                <p><strong><?php esc_html_e( 'BuddyBoss Platform is disabled.', 'buddyboss' ); ?></strong></p>
                <p><?php printf( esc_html__( 'The BuddyBoss Platform can\'t work while BuddyPress plugin is active. Please %s BuddyPress to re-enable BuddyBoss Platform.', 'buddyboss' ), $link_plugins ); ?></p>
            </div>

			<?php
		}

		// Disable bbPress message
		if ( $is_bb_active ) {

			if ( is_multisite() && ( is_network_admin() && ! in_array( $bb_plugin_file, $sitewide_plugins ) || in_array( $bb_plugin_file, $plugins ) ) ) {
				return;
			}
			$plugins_url  = is_network_admin() ? network_admin_url( 'plugins.php' ) : admin_url( 'plugins.php' );
			$link_plugins = sprintf( "<a href='%s'>%s</a>", $plugins_url, __( 'deactivate', 'buddyboss' ) );
			?>

            <div id="message" class="error notice">
                <p><strong><?php esc_html_e( 'BuddyBoss Platform is disabled.', 'buddyboss' ); ?></strong></p>
                <p><?php printf( esc_html__( 'The BuddyBoss Platform can\'t work while bbPress plugin is active. Please %s bbPress to re-enable BuddyBoss Platform.', 'buddyboss' ), $link_plugins ); ?></p>
            </div>

			<?php
		}

		if ( ! empty( $incompatible_plugins ) ) {
			foreach ( $incompatible_plugins as $incompatible_plugin_message ) {
				?>
                <div id="message" class="error notice">
                    <p><strong><?php esc_html_e( 'BuddyBoss Platform is disabled.', 'buddyboss' ); ?></strong></p>
					<?php
					printf( '<p>%s</p>', $incompatible_plugin_message ); ?>
                </div>
				<?php
			}
		}
	}

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.