bp_check_member_type_field_have_options()
Decide need to add profile field select box or not.
Description
Return
(bool)
Source
File: bp-xprofile/bp-xprofile-functions.php
function bp_check_member_type_field_have_options() { $arr = array(); // Get posts of custom post type selected. $posts = new \WP_Query( array( 'posts_per_page' => - 1, 'post_type' => bp_get_member_type_post_type(), 'orderby' => 'title', 'order' => 'ASC' ) ); if ( $posts ) { foreach ( $posts->posts as $post ) { $enabled = get_post_meta( $post->ID, '_bp_member_type_enable_profile_field', true ); if ( '' === $enabled || '1' === $enabled ) { $arr[] = $post->ID; } } } if ( empty( $arr ) ) { return false; } else { return true; } }
Changelog
Version | Description |
---|---|
BuddyBoss 1.1.3 | 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.