Alert: 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 Description


Return Return

(void) If default field or if the field does not support the feature.


Top ↑

Source Source

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

1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
private function visibility_metabox() {
 
    // Default field cannot have custom visibility.
    if ( true === $this->is_default_field() ) {
        return;
    } ?>
 
    <div class="postbox">
        <h2><label for="default-visibility"><?php esc_html_e( 'Visibility', 'buddypress' ); ?></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', 'buddypress' ); ?></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', 'buddypress' ); ?></label>
                    </li>
                </ul>
            </div>
        </div>
    </div>
 
    <?php
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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