Last active
December 22, 2017 10:20
-
-
Save manchumahara/d1f234358e1c362d561a516b9958ee03 to your computer and use it in GitHub Desktop.
Check if the post is bookmarked by user (user id or by current logged in user) https://codeboxr.com/documentation-for-cbx-bookmark-for-wordpress/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check if the current user has bookmarked any post | |
if(class_exists('CBXWPBookmarkHelper')){ | |
$current_user = wp_get_current_user(); | |
$user_id = $current_user->ID ; | |
global $post; | |
$post_id = $post->ID; //if you are trying outside of | |
$bookmark_by_user = CBXWPBookmarkHelper::isBookmarkedUser($post_id, $user_id); //true or false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment