Browse: Home / Functions /

learndash_shortcode_can_current_user_access_post

learndash_shortcode_can_current_user_access_post( int $post_id )

Checks if the current user can access the post.


Description #

If the post ID is not set, the current user can access the post. It allows the shortcode’s optional parameters to be skipped. If the post is password protected, then only admins can access the post. If the current user is a guest, the user can only access published posts. If the current user is logged in, they can only access posts they have access to.


Parameters #

$post_id

(int) (Required) Post ID.


Return #

(bool)


Source #

File: includes/shortcodes/shortcodes-functions.php


Changelog #

Changelog
Version Description
4.11.0 Introduced.