Skip to content
Help Center
  • Pricing
  • ProductsExpand
    • Premium PlansGet all the tools you need in one plan
    • Kadence ThemeLightning-fast performance theme for modern websites
    • Kadence BlocksDrop in ready designs with advanced controls for pixel perfect websites
    • Kadence Shop KitCreate a more effective WooCommerce shopping experience
    • Kadence ConversionsBoost sales and build engaged audiences with popups and banners
    • Kadence InsightsEasily create A/B tests. Optimize your pages to drive higher conversions.
    • View All Products
    • Get Kadence + Hosting
      In One Place

      Enjoy faster setup, top-tier performance, and worry-free WordPress hosting – Kadence Theme, Kadence Blocks, and Solid Security all pre-installed.

      Learn More

  • Kadence AI
  • Starter Templates
  • Blog
  • SupportExpand
    • Resource HubStart here for guides, Product docs, FAQs, and Troubleshooting tips, all in one place.
    • Contact SupportStuck on something? We’re here to help! Open a ticket for top-notch support.
    • Contact Our TeamGot pre-sales questions or need help choosing a plan? Open a ticket and our team will guide you.
    • About usCrafted with love in Missoula, Montana. Meet the team behind the mission.
Account Account
Get Kadence
Kadence Pattern Hub
  • Features
  • Use Cases
  • HelpExpand
    • Documentation
    • Facebook Group
    • Submit a Ticket
    • Feature Requests
    • Changelog
Help Center
Kadence Pattern Hub

Pattern Hub

  • How to Create Your Own Pattern Hub
  • Kadence Pattern Hub Pages
  • Creating Categories and Search Terms
  • How to Set the Order of Pattern Hub Items
  • How to Generate Pattern Hub Preview Thumbnails
  • How to Remove Access Keys
  • Resolving the No Connection Data Error in Pattern Hub

Selling Access

  • How to Sell Access Keys (Woocommerce)
  • How to Sell Access Keys (SureCart)
  • How to Offer Free Items and Show Premium Items
  • How To Sell Keys From One Site For Libraries Hosted On Another

Advanced Access Keys

  • How To Limit Access Keys to Specific Collections
  • How To Limit an Access Key to a Specific Site
  • Home
  • Knowledge Base
  • Kadence Pattern Hub
  • Kadence Cloud
  • Selling Access

How to Offer Free Items and Show Premium Items

If you are selling access to your Pattern Hub, you may want to offer some limited free access. One option is to create one simple access key in the Pattern Hub settings and give that out to anyone who wants free access. Then, you can target that key with a filter and make sure it blocks access to all the library items of a specific “pro” category.

We created a video tutorial covering the steps.

Step 1. Create a “Pro” category

First, create a Category for your Pro Pattern Items. This can be done in your Dashboard -> Pattern Hub -> Categories. Then, assign your Pro Pattern Items to this Category.

To assign one of your categories with a pro label, you can use the following filter.

/**
 * Apply a pro tag based on the cloud library category.
 *
 * @param boolean $enabled true or false based on if pro.
 * @param object  $post the current cloud library item post object.
 * @param array   $request_extras an array of extra information.
 * @return Boolean based on if access should be labeled pro.
 */
function custom_kadence_cloud_add_pro_tag( $enabled, $post, $request_extras ) {
	if ( has_term( 'pro', 'kadence-cloud-categories', $post ) ) {
		return true;
	}
	return $enabled;
}
add_filter( 'kadence_cloud_post_is_pro', 'custom_kadence_cloud_add_pro_tag', 10, 3 );

This example assumes you have a category with the slug “pro”.

Step 2. Filter the request to see if the key has access to pro items.

Next, we want to add a tag we can reference to see if the given request is for our free key, and if it is, make sure to lock down the pro category items. The code below assumes your free access key is “free”.

/**
 * Checks if key is "free" and adds request extra specifying.
 *
 * @param array           $args true or false based on access.
 * @param WP_REST_Request $request full details about the request.
 * @return array with variables for request.
 */
function custom_kadence_cloud_add_extra_args( $args, $request ) {
	$key = $request->get_param( 'key' );
	$args['pro_access'] = true;
	if ( 'free' === $key ) {
		$args['pro_access'] = false;
	}
	return $args;
}
add_filter( 'kadence_cloud_rest_request_extras', 'custom_kadence_cloud_add_extra_args', 20, 2 );

Step 3. Filter access to pro items

Using the “pro_access” argument we filtered in above, we will check that on a per-item basis to see if we need to lock the item from the user.

/**
 * Lock access to specific cloud library items.
 *
 * @param boolean $enabled true or false based on if pro.
 * @param object  $post the current cloud library item post object.
 * @param array   $request_extras an array of extra information.
 * @return Boolean based on if access should be labeled pro.
 */
function custom_kadence_cloud_lock_pro_tag( $enabled, $post, $request_extras ) {
	if ( has_term( 'pro', 'kadence-cloud-categories', $post ) && ! $request_extras['pro_access'] ) {
		return true;
	}
	return $enabled;
}
add_filter( 'kadence_cloud_post_is_locked', 'custom_kadence_cloud_lock_pro_tag', 10, 3 );
Do you feel this document was helpful?
How to Sell Access Keys (SureCart)How To Sell Keys From One Site For Libraries Hosted On Another
The Kadence WP Logo
Crafted in Missoula, Montana
  • Follow Kadence on Facebook
  • Follow Kadence on Youtube
  • X
  • Follow Kadence on Instagram
Trustpilot
Products
  • Kadence Plans
  • Kadence Theme
  • Kadence Blocks
  • Kadence AI
  • Kadence Starter Templates
  • Kadence Shop Kit
  • Kadence Conversions
  • Kadence Pattern Hub
  • View All
Resources
  • Blog
  • Podcast
  • Knowledgebase
  • Support ticket
  • Feature Requests
  • FAQ
  • WordPress Hosting Services
About Us
  • About Kadence
  • Become an affiliate
  • Contact us
  • Terms
  • Privacy Policy
  • Security
Our Partner Brands
  • SolidWP
  • LearnDash
  • The Events Calendar
  • GiveWP
  • MemberDash
Kadence Community
  • Kadence Marketplace
  • Join the Facebook Group
  • Subscribe to our YouTube Channel
© 2024 Kadence WP | All prices are in USD
Logo for StellarWP an umbrella brand of Premium WordPress plugins
  • Pricing
  • Products
    • Premium PlansGet all the tools you need in one plan
    • Kadence ThemeLightning-fast performance theme for modern websites
    • Kadence BlocksDrop in ready designs with advanced controls for pixel perfect websites
    • Kadence Shop KitCreate a more effective WooCommerce shopping experience
    • Kadence ConversionsBoost sales and build engaged audiences with popups and banners
    • Kadence InsightsEasily create A/B tests. Optimize your pages to drive higher conversions.
    • View All Products
    • Get Kadence + Hosting
      In One Place

      Enjoy faster setup, top-tier performance, and worry-free WordPress hosting – Kadence Theme, Kadence Blocks, and Solid Security all pre-installed.

      Learn More

  • Kadence AI
  • Starter Templates
  • Blog
  • Support
    • Resource HubStart here for guides, Product docs, FAQs, and Troubleshooting tips, all in one place.
    • Contact SupportStuck on something? We’re here to help! Open a ticket for top-notch support.
    • Contact Our TeamGot pre-sales questions or need help choosing a plan? Open a ticket and our team will guide you.
    • About usCrafted with love in Missoula, Montana. Meet the team behind the mission.
Account Login
  • Features
  • Use Cases
  • HelpExpand
    • Documentation
    • Facebook Group
    • Submit a Ticket
    • Feature Requests
    • Changelog