Created
April 23, 2015 16:08
-
-
Save mikejolley/2452564524082cba2a77 to your computer and use it in GitHub Desktop.
Disable bookmarks for users without a subscription
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
add_action( 'init', 'disable_bookmark_functionality' ); | |
function disable_bookmark_functionality() { | |
$subscription_product_id = '116'; // Customise me! | |
if ( ! is_user_logged_in() || ! WC_Subscriptions_Manager::user_has_subscription( get_current_user_id(), $subscription_product_id ) ) { | |
remove_action( 'single_job_listing_meta_after', array( $GLOBALS['job_manager_bookmarks'], 'bookmark_form' ) ); | |
remove_action( 'single_resume_start', array( $GLOBALS['job_manager_bookmarks'], 'bookmark_form' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment