-
Author
Tagged: restrictions, fields, pricing, pmpro
-
March 31, 2014 at 00:44 #13909mckownParticipant
How do we add featured items to membership levels on the pricing page? I see where we can hide items such as “Send Private Messages” but we need to be able to add items outside of social features because those are what really makes the difference between a free & paid membership .. such as “Access to Premium Pages” “Free Monthly Downloads” and so on. I don’t mind hardcoding these into the theme or plugin for now .. just need to know what file to alter.
April 1, 2014 at 23:51 #14077AbeKeymasterHi,
See my example below where I add a new MESSAGES RESTRICTION and SHOP. The following codes goes to kleo-child/functions.phpThis manipulates the text that shows in the memberhips page:
COPY CODE/* These restrictions will appear to be configured in Sweetdate - 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; }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.June 25, 2014 at 18:52 #20888SplendorParticipantI need to add this to my job page, the later code could then suffice?
June 26, 2014 at 12:03 #20957AbeKeymasterIf you have a page, then go to that page edit in wp admin and apply the restrictions from that page. It should look like in the attachment.
For the restriction to appear in the Levels page then you need to use the first code example
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.Attachments:
You must be logged in to view attached files.June 26, 2014 at 13:11 #20976SplendorParticipantoki, because I added membership levels and I check those but it seems to ignore those. But seems to work on other pages.
Attachments:
You must be logged in to view attached files.June 27, 2014 at 18:34 #21143AbeKeymasterWell if it is a special page from a plugin then that could happen and you will have to do some plugin related checks to check for that page and apply the restrictions manually
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.July 28, 2014 at 18:13 #23825potion5ParticipantVery nice, thank you. I used a custom post type to allow ordinary admins (not developers) to easily change membership features from the admin back-end. I’ve included the code below. However, I do not think that this should be solved using custom post types. Is there a way to hook into the Theme Options -> Membership admin panel and add an editable list of features there instead?
COPY CODE<?php /** * @package Membership_Features * @version 0.1 */ /* Plugin Name: Membership Features Description: Implements a custom post type, "Feature", which replaces the default features used in the membership pricing table of the <a href="http://themeforest.net/item/kleo-next-level-premium-wordpress-theme/6776630">Kleo Theme</a>. To use, first create new features as required, then enable or disable them in the Theme Options -> Memberships. Author: Potion Version: 0.1 */ /** * Register custom post type: membership_feature */ add_action( 'init', 'create_feature_post_type' ); function create_feature_post_type() { register_post_type( 'membership_feature', array( 'labels' => array( 'name' => _x( 'Features' ), 'singular_name' => _x( 'Feature' ), 'add_new' => _x( 'Add New' ), 'add_new_item' => __( 'Add New Feature' ), 'edit_item' => __( 'Edit Feature' ), 'new_item' => __( 'New Feature' ), 'all_items' => __( 'All Features' ), 'view_item' => __( 'View Feature' ), 'search_items' => __( 'Search Features' ), 'not_found' => __( 'No features found' ), 'not_found_in_trash' => __( 'No features found in Trash' ), 'parent_item_colon' => '', 'menu_name' => __( 'Features' ), ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'feature' ), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => 120, 'supports' => array( 'title') ) ); } /** * Use membership_feature posts to populate features for Kleo Theme Membership Level Pricing Table */ add_filter('kleo_pmpro_level_restrictions', 'kleo_my_levels_checkmarks'); function kleo_my_levels_checkmarks($settings) { $args = array( 'post_type' => 'membership_feature', 'posts_per_page' => -1); query_posts( $args ); if (have_posts) { $settings = array (); while (have_posts()) : the_post(); array_push( $settings, array( 'title' => __('Restrict ' . get_the_title(), 'kleo_framework'), 'front' => __( get_the_title(), 'kleo_framework'), 'name' => basename(get_permalink($post->ID)) ) ); endwhile; } wp_reset_query(); return $settings; }
July 28, 2014 at 19:17 #23845AbeKeymasterThanks for sharing. We will think of a solution.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.July 28, 2014 at 19:28 #23848bwoolleyParticipantPlus one for being able to more easily specify the contents of the tables without coding… 🙂
August 5, 2014 at 22:08 #24793AdamParticipant@abe this seems to only work when user profiles are found at /members/username
if(preg_match(“/^\/”.bp_get_members_root_slug().”\/”. bp_get_loggedin_user_username().”\/messages\/?/”, $uri))
what about when root profiles are enabled?
I tried this:
if(preg_match(“/^\/”. bp_get_loggedin_user_username().”\/messages\/?/”, $uri))but it didn’t work either
August 5, 2014 at 23:37 #24801AdamParticipant@caitlin
how to make the custom restrictions match URI when root profiles are enabled?
getting:
PHP Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslashwhen I try to modify for URLs that do not contain /members/
August 6, 2014 at 01:33 #24808AdamParticipant/members/, $uri
it’s always simpler than I think. Well there goes a few hours.
September 2, 2014 at 21:58 #27379andpixelsParticipantAbe,
This didn’t really solve the question that was initially asked. Basically, how do you add custom content into the various levels. For example I want to add something in Level 2 & 3 but not Level 1, I should be able to type that content into 2 & 3.
See attachment showing the variations of each level. How do we do this?
Attachments:
You must be logged in to view attached files.September 2, 2014 at 22:05 #27382andpixelsParticipantAlso, I don’t see how the code above changes the permissions for a user level within a Forum for BBPress. Can you update the code above or write a new version that would allow us to select the user level that is able to see a forum page?
September 2, 2014 at 22:08 #27384andpixelsParticipantSolved my last permission issue with the PMPro BBPress Forums security addon.
September 8, 2014 at 02:12 #27884ParkproductionsParticipantHow does the example code work if I have 3 membership options and want to add unique features to one box? At the moment it will add a feature to all price tables not just a specific one.
September 11, 2014 at 00:16 #28295AbeKeymasterRight now you can’t add a feature to just one level. It appears in all levels. You could write it int he description field from the level edit.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.September 11, 2014 at 01:54 #28313ParkproductionsParticipantThanks for the response, I hope this feature can be added to new updates of the theme.
September 23, 2014 at 23:35 #29454cinechopperParticipantI’m sorry, but I absolutely cannot find the kleo-child/functions.php location to change things. I’m trying to change the membership levels or even just delete them. Can someone help me? I’m a long time WP user but a coding noob.
Thanks!Attachments:
You must be logged in to view attached files.September 26, 2014 at 11:16 #29802moosemanmediaParticipantUp 1, it really seems like natural option that should be available: change features according to the different levels. Using the description field is rather limited (layoutwise…)
September 26, 2014 at 15:37 #29845AbeKeymaster@cinechopper you need to upload your child theme in case you haven’t. the full path on your server should be wp-content/themes/kleo-child
After you define your features they should appear in Theme options – Memberships so you can configure each feature for each level to set if is available or not for that level
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.September 29, 2014 at 16:04 #30096cohibaParticipantI would like to add additional user fields after payment. 1. With KLEO theme is this really as easy as just clicking/adding the fields in the user field add edit page? & 2. Is it possible to create drop-down options for user fields?
Also, is there any way to collect user information prior to subscription payment? Thanks!
-CG
October 2, 2014 at 00:37 #30409AbeKeymaster@cohiba
Payment process and Paid memberships pro is somehow the same as for Sweetdate so if you want that functionality you will have to implement it yourself.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 5, 2014 at 04:06 #30670creativesinsideParticipantHi! Just bought this theme! So I am a bit confused! Since there are different membership levels … each one would have different abilities right??? Isn’t that the point?
So I have to use custom code as in above in order to do this?
There is not some easy way in the theme?
They all automatically have the same features?
October 6, 2014 at 19:07 #30863AbeKeymasterHi, after you add the code above to change our default descriptions, you will find them in Theme options – Memberships where you can configure them for each level. Based on your config they will appear checked or greyed out.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 6, 2014 at 19:16 #30867lchildParticipantHi!
I’ve just added the codes above to add options to the Membership Levels, but all restrictions appear on all Levels, without making any distinction regarding the Level for which it was configured…
What I mean is, they all appear with a checkmark, even if they’re restricted on that specific Level. What can I do?
Thanks for replying!
Laura
October 9, 2014 at 17:28 #31198AbeKeymasterWell I will just copy/paste my answer above:
“Hi, after you add the code above to change our default descriptions, you will find them in Theme options – Memberships where you can configure them for each level. Based on your config they will appear checked or greyed out. “
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.November 12, 2014 at 17:58 #35226xsoftwebParticipant@Abe,
I don’t think it really make sense not to be able to change the membership level content. We are the users, we want something different from the default listing. I support andpixels’ suggestion.Each level with different features and content. Please inform your team to work on it as soon as possible.
November 13, 2014 at 00:59 #35282AbeKeymasterxsoftweb I don’t think you have read my posts in the topic since it does just that 😉
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 31, 2015 at 23:20 #52571khudro-softParticipantHi i want to know how can i add extra field such as company name, company address in pmpro registration?
Please give me a solution asap i am struggling so much .
Thank You
April 3, 2015 at 19:02 #53087AbeKeymasterHi, you should read this https://github.com/strangerstudios/pmpro-register-helper
Also if it is our of your tech knowledge scope maybe you will have to hire a developer to implement that
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.July 1, 2015 at 09:22 #65941maxhiltonParticipantHi,
Can I know where can I paste this code ? I’m not good in coding part so please kindly guide me on this. Thanks.
——————————————————————————————————-
<?php
/**
* @package Membership_Features
* @version 0.1
*/
/*
Plugin Name: Membership Features
Description: Implements a custom post type, “Feature”, which replaces the default features used in the membership pricing table of the Kleo Theme. To use, first create new features as required, then enable or disable them in the Theme Options -> Memberships.
Author: Potion
Version: 0.1
*//**
* Register custom post type: membership_feature
*/
add_action( ‘init’, ‘create_feature_post_type’ );
function create_feature_post_type() {
register_post_type( ‘membership_feature’,
array(
‘labels’ => array(
‘name’ => _x( ‘Features’ ),
‘singular_name’ => _x( ‘Feature’ ),
‘add_new’ => _x( ‘Add New’ ),
‘add_new_item’ => __( ‘Add New Feature’ ),
‘edit_item’ => __( ‘Edit Feature’ ),
‘new_item’ => __( ‘New Feature’ ),
‘all_items’ => __( ‘All Features’ ),
‘view_item’ => __( ‘View Feature’ ),
‘search_items’ => __( ‘Search Features’ ),
‘not_found’ => __( ‘No features found’ ),
‘not_found_in_trash’ => __( ‘No features found in Trash’ ),
‘parent_item_colon’ => ”,
‘menu_name’ => __( ‘Features’ ),
),
‘public’ => true,
‘publicly_queryable’ => true,
‘show_ui’ => true,
‘show_in_menu’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘feature’ ),
‘capability_type’ => ‘post’,
‘has_archive’ => true,
‘hierarchical’ => false,
‘menu_position’ => 120,
‘supports’ => array( ‘title’)
)
);
}/**
* Use membership_feature posts to populate features for Kleo Theme Membership Level Pricing Table
*/
add_filter(‘kleo_pmpro_level_restrictions’, ‘kleo_my_levels_checkmarks’);
function kleo_my_levels_checkmarks($settings) {$args = array(
‘post_type’ => ‘membership_feature’,
‘posts_per_page’ => -1);query_posts( $args );
if (have_posts) {
$settings = array ();
while (have_posts()) : the_post();
array_push( $settings, array(
‘title’ => __(‘Restrict ‘ . get_the_title(), ‘kleo_framework’),
‘front’ => __( get_the_title(), ‘kleo_framework’),
‘name’ => basename(get_permalink($post->ID))
)
);endwhile;
}wp_reset_query();
return $settings;
}
——————————————————————————————————–July 1, 2015 at 14:46 #65961AbeKeymasterHi @maxhilton
please don’t paste long text files here and instead attach them as text files. That is probably a wordpres plugin from the header so you can add it as a plugin on your site. Alternatively the code can be added to child theme/functions.phpHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.May 20, 2016 at 17:26 #122545zzkamikazezzParticipantHi
I am just wondering if there is now a way to do this?
I would like my membership pricing table to look like this:Free User:-
Create events to share
Search events
Personal profile page
VIEW MEMBERS DIRECTORY
VIEW MEMBERS PROFILE
ACCESS GROUP DIRECTORY
ACCESS TO GROUPS
SEND PRIVATE MESSAGES (Greyed out)
ADD MEDIA TO YOUR PROFILE (Greyed out)
Access to member only discounts (grey out, this will link to a protected page with discount codes)Supporter:-
Create events to share
Search events
Personal profile page
VIEW MEMBERS DIRECTORY
VIEW MEMBERS PROFILE
ACCESS GROUP DIRECTORY
ACCESS TO GROUPS
SEND PRIVATE MESSAGES
ADD MEDIA TO YOUR PROFILE
Access to member only discounts
Help keep the site up and running (this item is unique to this membership type in the table)May 20, 2016 at 18:39 #122567AbeKeymaster@zzkamikazezz please follow the example I have given here: https://archived.seventhqueen.com/forums/topic/membership-levels-price-page?bbp_reply_to=14077&_wpnonce=b440ba9eea#new-post
You will need a bit of programming knowledge. try to contact a programmer/developer to help if you need to make custom changes
All the best
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.May 20, 2016 at 18:54 #122574zzkamikazezzParticipantHi, that link you shared links to this page and the post new topic section, was that intended or is there more info in another thread you can share?
Thanks
-
AuthorPosts
The topic ‘Membership Levels add extra fields’ is closed to new replies.