Skip to content
Help Center
  • Pricing
  • ProductsExpand
    • Premium BundlesGet all the tools you need in one bundle
    • 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
  • AI Starter Templates
  • Blog
  • SupportExpand
    • Help CenterProduct Questions? Not sure how to do something? Start here
    • Support TicketsNeed help? We love to help our customers
    • About usCrafted with love in Missoula, Montana
    • Contact usPre Sale Questions? Need help purchasing?
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.
  • How to Generate Preview Thumbnails
  • Creating Categories and Search Terms
  • How to set the order of Patten Items
  • How to remove specific Access Keys

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.

Youtube Video

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 );
How to Sell Access Keys (SureCart)How to sell keys from one site for libraries hosted on another.
  • Pricing
  • Products
    • Premium BundlesGet all the tools you need in one bundle
    • 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
  • AI Starter Templates
  • Blog
  • Support
    • Help CenterProduct Questions? Not sure how to do something? Start here
    • Support TicketsNeed help? We love to help our customers
    • About usCrafted with love in Missoula, Montana
    • Contact usPre Sale Questions? Need help purchasing?
Account Login
  • Features
  • Use Cases
  • HelpExpand
    • Documentation
    • Facebook Group
    • Submit a Ticket
    • Feature Requests
    • Changelog