This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

BP_XProfile_Field::visibility_metabox()

Private method used to output field visibility metaboxes.

Description

Return

(void) If default field id 1.

Source

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

	private function visibility_metabox() {
		?>

        <div class="postbox">
            <h2><label for="default-visibility"><?php esc_html_e( 'Visibility', 'buddyboss' ); ?></label></h2>
            <div class="inside">
                <div>
                    <select name="default-visibility" id="default-visibility">

						<?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?>

                            <option value="<?php echo esc_attr( $level['id'] ); ?>" <?php selected( $this->get_default_visibility(), $level['id'] ); ?>>
								<?php echo esc_html( $level['label'] ); ?>
                            </option>

						<?php endforeach ?>

                    </select>
                </div>

                <div>
                    <ul>
                        <li>
                            <input type="radio" id="allow-custom-visibility-allowed" name="allow-custom-visibility"
                                   value="allowed" <?php checked( $this->get_allow_custom_visibility(), 'allowed' ); ?> />
                            <label for="allow-custom-visibility-allowed"><?php esc_html_e( 'Allow members to override', 'buddyboss' ); ?></label>
                        </li>
                        <li>
                            <input type="radio" id="allow-custom-visibility-disabled" name="allow-custom-visibility"
                                   value="disabled" <?php checked( $this->get_allow_custom_visibility(), 'disabled' ); ?> />
                            <label for="allow-custom-visibility-disabled"><?php esc_html_e( 'Enforce field visibility', 'buddyboss' ); ?></label>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

		<?php
	}

Changelog

Changelog
Version Description
BuddyPress 2.3.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.