bp_nouveau_signup_terms_privacy()

Output a terms of service and privacy policy pages if activated

Description

Source

File: bp-templates/bp-nouveau/includes/template-tags.php

function bp_nouveau_signup_terms_privacy() {

	$page_ids = bp_core_get_directory_page_ids();

	$terms   = isset( $page_ids['terms'] ) ? $page_ids['terms'] : false;
	$privacy = isset( $page_ids['privacy'] ) ? $page_ids['privacy'] : false;

	// Do not show the page if page is not published.
	if ( false !== $terms && 'publish' !== get_post_status( $terms ) ) {
		$terms = false;
	}

	// Do not show the page if page is not published.
	if ( false !== $privacy && 'publish' !== get_post_status( $privacy ) ) {
		$privacy = false;
	}

	if ( ! $terms && ! $privacy ) {
	    return false;
    }

	if ( $terms && ! $privacy ) {
		?>
        <p class="register-privacy-info">
            <?php printf( __( 'terms-modalBy creating an account you are agreeing to the <a class="popup-modal-register popup-terms" href="#terms-modal">%s</a>.', 'buddyboss' ), get_the_title( $terms ) ); ?>
        </p>
		<div id="terms-modal" class="mfp-hide registration-popup bb-modal">
			<h1><?php echo esc_html( get_the_title( $terms ) ); ?></h1>
			<?php
			$get_terms = get_post( $terms );
			echo wp_kses_post( apply_filters( 'the_content',  $get_terms->post_content ) );
			?>
			<button title="<?php esc_attr_e( 'Close (Esc)', 'buddyboss'); ?>" type="button" class="mfp-close"><?php esc_html_e('×','buddyboss');?></button>
		</div>
		<?php
	}

	if ( ! $terms && $privacy ) {
		?>
        <p class="register-privacy-info">
            <?php printf( __( 'By creating an account you are agreeing to the <a class="popup-modal-register popup-privacy" href="#privacy-modal">%s</a>.', 'buddyboss' ), get_the_title( $privacy ) ); ?>
        </p>
		<div id="privacy-modal" class="mfp-hide registration-popup bb-modal">
			<h1><?php echo esc_html( get_the_title( $privacy ) ); ?></h1>
			<?php
			$get_privacy = get_post( $privacy );
			echo wp_kses_post( apply_filters( 'the_content',  $get_privacy->post_content ) );
			?>
			<button title="<?php esc_attr_e( 'Close (Esc)', 'buddyboss'); ?>" type="button" class="mfp-close"><?php esc_html_e('×','buddyboss');?></button>
		</div>
		<?php
	}

	if ( $terms && $privacy ) {
		?>
        <p class="register-privacy-info">
            <?php printf( __( 'By creating an account you are agreeing to the <a class="popup-modal-register popup-terms" href="#terms-modal">%s</a> and <a class="popup-modal-register popup-privacy" href="#privacy-modal">%s</a>.', 'buddyboss' ), get_the_title( $terms ), get_the_title( $privacy ) ); ?>
        </p>
		<div id="terms-modal" class="mfp-hide registration-popup bb-modal">
			<h1><?php echo esc_html( get_the_title( $terms ) ); ?></h1>
			<?php
			$get_terms = get_post( $terms );
			echo wp_kses_post( apply_filters( 'the_content',  $get_terms->post_content ) );
			?>
			<button title="<?php esc_attr_e( 'Close (Esc)', 'buddyboss'); ?>" type="button" class="mfp-close"><?php esc_html_e('×','buddyboss');?></button>
		</div>
		<div id="privacy-modal" class="mfp-hide registration-popup bb-modal">
			<h1><?php echo esc_html( get_the_title( $privacy ) ); ?></h1>
			<?php
			$get_privacy = get_post( $privacy );
			echo wp_kses_post( apply_filters( 'the_content',  $get_privacy->post_content ) );
			?>
			<button title="<?php esc_attr_e( 'Close (Esc)', 'buddyboss'); ?>" type="button" class="mfp-close"><?php esc_html_e('×','buddyboss');?></button>
		</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.