Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created April 23, 2015 16:08
Show Gist options
  • Save mikejolley/2452564524082cba2a77 to your computer and use it in GitHub Desktop.
Save mikejolley/2452564524082cba2a77 to your computer and use it in GitHub Desktop.
Disable bookmarks for users without a subscription
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