• Dashboard
    • Submit Ticket
    • Licenses
    • Login
  • Our Products
    • BuddyBuilder
    • Kleo
    • Typer
    • Seeko
    • SweetDate
    • BuddyApp
  • Services
    • VIP Support
    • WordPress Theme Installation Service
  1. Home
  2. Kleo
  3. Add Extra Membership Levels Fields

Add Extra Membership Levels Fields

To add extra fields to membership levels, follow this example:

We add a new MESSAGES RESTRICTION and SHOP. The following codes goes to kleo-child/functions.php

This manipulates the text that shows in the memberships page:

COPY CODE
/* These restrictions will appear to be configured in Theme options - Memberships */
add_filter('kleo_pmpro_level_restrictions', 'kleo_my_levels_checkmarks');
function kleo_my_levels_checkmarks($settings) {
 
    $settings = array (
		//NEW RESTRICTION MESSAGES page with name: message
        array(
            'title' => __('Restrict Messages page','kleo_framework'),
            'front' => __('Access messages page','kleo_framework'),
            'name' => 'message'
        ),
		//NEW RESTRICTION SHOP page with name: shop
        array(
            'title' => __('Restrict Shop page','kleo_framework'),
            'front' => __('Access Shop page','kleo_framework'),
            'name' => 'shop'
        ),
        array(
            'title' => __('Restrict members directory','kleo_framework'),
            'front' => __('View members directory','kleo_framework'),
            'name' => 'members_dir'
        ),
        array(
            'title' => __('Restrict viewing other profiles','kleo_framework'),
            'front' => __('View members profile','kleo_framework'),
            'name' => 'view_profiles'
        ),
        array(
            'title' => __('Restrict access to groups directory','kleo_framework'),
            'front' => __('Access group directory','kleo_framework'),
            'name' => 'groups_dir'
        ),
        array(
            'title' => __('Restrict access to single group page','kleo_framework'),
            'front' => __('Access to groups','kleo_framework'),
            'name' => 'view_groups'
        ),
        array(
            'title' => __('Restrict users from viewing site activity','kleo_framework'),
            'front' => __('View site activity','kleo_framework'),
            'name' => 'show_activity'
        ),
        array(
            'title' => __('Restrict users from sending private messages','kleo_framework'),
            'front' => __('Send Private messages','kleo_framework'),
            'name' => 'pm'
        ),
        array(
            'title' => __('Restrict users from adding media to their profile using rtMedia or bpAlbum','kleo_framework'),
            'front' => __('Add media to your profile','kleo_framework'),
            'name' => 'add_media'
        )
    );
    return $settings;
}

If you need also to apply restrictions to some links and not just show some text in the levels page, this makes the page restrictions to happen:

COPY CODE
// restrict profile area - Messages page
add_action('kleo_pmro_extra_restriction_before_my_profile','kleo_my_custom_restrict1');

function kleo_my_custom_restrict1()
{
	//full current url
	$actual_link = kleo_full_url();
	//our request uri
	$uri = str_replace(untrailingslashit(home_url()),"",$actual_link);

	//restrict messaging page url
	if(preg_match("/^\/".bp_get_members_root_slug()."\/". bp_get_loggedin_user_username()."\/messages\/?/", $uri))
	{
		
		$my_restrictions =  array('message' => array(
				//2 - restrict certain levels. 0 -restrict none; 1 - restrict all
				'type' => 2,
				//levels that you apply the restrictions to
				'levels' => array(2,3),
				//'not_member' => 1, //restrict users without a membership level
				//'guest' => 1 // restrict not logged in users
			)
		);
		//We use the name "message" from the new restriction added above
		kleo_check_access('message',$my_restrictions);
	}
}

//Restrict Shop page
add_filter('kleo_pmpro_match_rules', 'kleo_my_custom_restrict2');

function kleo_my_custom_restrict2($restrictions) {
	//regular expression for shop page
	$restrictions["/^\/shop\/?$/"] = array('name' => 'shop');
	return $restrictions;
}

If you need more information, follow this thread http://seventhqueen.com/support/forums/topic/membership-levels-price-page

Blazing Fast Site Hosting & Maintenance

  • Welcome to Kleo!
  • Theme Requirements
  • What's included in the theme
  • WordPress Installation
  • How to Install Kleo Theme
  • Install recommended and required plugins
  • Import demo pages and content
  • How to Update the Theme
  • How to update WPBakery
  • Updating to KLEO 4.9
  • Theme Automatic Updates
  • BuddyPress overview
  • How to update WPBakery
  • bbPress overview
  • How To Install and Setup GeoDirectory V1
  • Youzer and Buddypress Integration with Kleo theme
  • Membership overview
  • rtMedia overview
  • WP Bakery Page Builder
  • Restrict content for certain membership level
  • Paid Memberships Pro
  • Restrict content only for logged in users
  • Enabling BuddyPress Groups
  • GeoDirectory Migrate to version 2.0
  • Bundled plugins and activation codes
  • Add link to element or button in Revolution Slider 6.x
  • How to Build Pages With WPBakery Page Builder in Kleo theme
  • Introduction to the child theme
  • How to Setup Facebook Login / Fix Facebook Login
  • Overriding a file with the child theme
  • Increase Site Performance using Kleo theme settings
  • Changing section icons in profiles and groups
  • Theme Options overview
  • Using ##profile_link## to build a dynamic BuddyPress profile menu
  • How To Add Google Custom Search Box To Replace WordPress Search in Header
  • How to Create a New Menu and Modify Demo Menu
  • Find Theme Purchase Code
  • Translate theme with Loco Translate
  • Multilingual setup using WPML plugin
  • How to translate Kleo theme with Polylang Plugin
  • Video Tutorials from the Community
  • How To Install and Setup GeoDirectory on Kleo Theme
  • Import and setup Get Connected demo page
  • How to Translate Theme and Plugins With Loco Translate
  • How to Setup BuddyPress Page Layout
  • How to Create a New Menu and Modify Demo Menu
  • How to change background for Get Connected Layout
  • How to change background for Kleo Home Register layout
  • How To Install and Setup GeoDirectory V1
  • Show profile fields in the members directory
  • Shortcodes for KLEO
  • Changelog
  • My site is slow. How to speed up my website?
  • How To Link Your WordPress Site With HubSpot
  • Dequeue and deregister the APP.JS theme file and load it from child theme.
  • Ajax Interval Refresh - Menu Notifications & Messages
  • How To Add Google Custom Search Box To Replace WordPress Search in Header
  • Custom Post Type - Add Theme Metaboxes and Theme settings Metaboxes
  • Right Hand DropDown Menu Cut Off
  • Modify default image sizes from category pages
  • Remove KLEO from Wordpress TinyMCE
  • Change KLEO Page Title for Archives and Other WordPress Pages
  • Use custom fontello font icons for in Kleo Theme
  • Reset Kleo Love/Likes
  • How to add a Populated Country List XPROFILE
  • Add Extra Membership Levels Fields
  • Show featured image full width before the content area
  • Make “Profile” tab Default Instead of “Activity” tab at User Profile
  • Add theme metaboxes and theme settings metaboxes CPT
  • Redirect "or Create an Account" Login Modal link to a Custom Register Page
  • Add a custom color preset for Theme options Styling sections
  • Show Kleo Love/Likes Only for logged in Users
  • UberMenu Integration
  • How to change logo url
  • Troubleshooting an issue
  • Error 404 - Page not found
  • Show profile fields in the members directory
  • Show profile fields in the profile header
  • Changing section icons in profiles and groups
BuddyBuilder is out. Total freedom to build online communities
SeventhQueen  - 2021 - Privacy Policy

Welcome to SeventhQueen Portal


Lost your password?

Don't have an account? Register now!

Forgot your details?



Wait, I remember now. Log In

Register your account

Sign up with Email
I have an account. Log In

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.