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

2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
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.