Tribe__Tickets_Plus__Attendees_List::is_hidden_on( int|WP_Post $post, boolean $strict = true )
Determine if we need to hide the attendees list.
Contents
Parameters
- $post
-
(int|WP_Post) (Required) The post object or ID.
- $strict
-
(boolean) (Optional) Whether to strictly check the meta value.
Default value: true
Return
(bool) Whether the attendees list is hidden.
Source
File: src/Tribe/Attendees_List.php
public static function is_hidden_on( $post ) {
if ( is_numeric( $post ) ) {
$post = WP_Post::get_instance( $post );
}
if ( ! $post instanceof WP_Post ) {
return false;
}
$is_hidden = get_post_meta( $post->ID, self::HIDE_META_KEY, true );
// By default non-existent meta will be an empty string
if ( '' === $is_hidden ) {
/**
* Default to hide - which is unchecked but stored as true (1) in the Db for backwards compat.
*
* @since 4.5.1
*/
$is_hidden = true;
} else {
/**
* Invert logic for backwards compat.
*
* @since 4.5.1
*/
$is_hidden = ! $is_hidden;
}
/**
* Use this to filter and hide the Attendees List for a specific post or all of them
*
* @param bool $is_hidden
* @param WP_Post $post
*/
return apply_filters( 'tribe_tickets_plus_hide_attendees_list', $is_hidden, $post );
}