Session::post_in_session( mixed $_post )
Description #
Check if post is in user’s session.
Parameters #
- $_postmixed (Required) WordPress post object or ID.
Source #
File: includes/class/class-session.php
public function post_in_session( $_post ) { $_post = ap_get_post( $_post ); $session_type = 'answer' === $_post->post_type ? 'answers' : 'questions'; $session_posts = anspress()->session->get( $session_type ); if ( ! empty( $session_posts ) && ! is_user_logged_in() && '0' === $_post->post_author && in_array( (int) $_post->ID, $session_posts, true ) ) { return true; } return false; }
Expand full source code Collapse full source code View on GitHub: includes/class/class-session.php:226
Add your comment