Community Support Forums — WordPress® ( Users Helping Users ) — 2011-08-04T17:02:24-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14172 2011-08-04T17:02:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=29883#p29883 <![CDATA[Re: Custom Capabilities Question]]>
Code:
add_action("gform_user_registered", "add_custom_user_meta", 10, 3);  

function add_custom_user_meta
($user_id, $config, $entry) {  
    wp_set_current_user
( $user_id );
    $user = wp_get_current_user(); 
    $user
->add_cap("access_s2member_ccap_music"); 
} 


i know the set current user fuction returns the WP_user object, I just don't know how to access the return value.

Statistics: Posted by fcp2011 — August 4th, 2011, 5:02 pm


]]>
2011-08-04T11:30:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=29852#p29852 <![CDATA[Re: Custom Capabilities Question]]> Statistics: Posted by fcp2011 — August 4th, 2011, 11:30 am


]]>
2011-08-03T23:56:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=29807#p29807 <![CDATA[Re: Custom Capabilities Question]]> viewtopic.php?f=4&t=14172#p28963

Does that help?

Statistics: Posted by Cristián Lávaque — August 3rd, 2011, 11:56 pm


]]>
2011-08-03T23:34:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=29806#p29806 <![CDATA[Re: Custom Capabilities Question]]> Statistics: Posted by fcp2011 — August 3rd, 2011, 11:34 pm


]]>
2011-08-03T18:37:22-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=29771#p29771 <![CDATA[Re: Custom Capabilities Question]]>
$user_id->add_cap ("access_s2member_ccap_test");

Fatal error: Call to a member function add_cap() on a non-object in /home3/freecla3/public_html/wp-content/themes/Superb/functions.php on line 502

Statistics: Posted by fcp2011 — August 3rd, 2011, 6:37 pm


]]>
2011-08-03T13:32:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=29761#p29761 <![CDATA[Re: Custom Capabilities Question]]> Statistics: Posted by fcp2011 — August 3rd, 2011, 1:32 pm


]]>
2011-08-02T19:16:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=29666#p29666 <![CDATA[Re: Custom Capabilities Question]]> Statistics: Posted by fcp2011 — August 2nd, 2011, 7:16 pm


]]>
2011-07-22T22:56:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28963#p28963 <![CDATA[Re: Custom Capabilities Question]]>
You can do something like this to add an s2Member custom capability:

Code:
<?php
$user 
wp_get_current_user();
$user->add_cap("access_s2member_ccap_music");
?>


https://codex.wordpress.org/Function_Reference/add_cap
https://codex.wordpress.org/Function_Re ... remove_cap

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — July 22nd, 2011, 10:56 pm


]]>
2011-07-22T15:13:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28934#p28934 <![CDATA[Re: Custom Capabilities Question]]>
The first one is without a custom capability
a:1:{s:15:"s2member_level1";s:1:"1";}

The second one here is with a "trial" capability
a:2:{s:15:"s2member_level1";s:1:"1";s:26:"access_s2member_ccap_trial";s:1:"1";}

I see that the a:1 changes to a:2 and that the string/array adds a s:1 of 1 as well at the end. When I subsequently remove the "trial" from the user's side, it changes back.

Any help or documentation on this would be great. Is there a filter or function that is available that can be accessed to add the custom capabilities of a user programatically vice manually?

Thanks for your help on this and all matters.

Statistics: Posted by fcp2011 — July 22nd, 2011, 3:13 pm


]]>
2011-07-21T22:30:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28897#p28897 <![CDATA[Re: Custom Capabilities Question]]> Statistics: Posted by Cristián Lávaque — July 21st, 2011, 10:30 pm


]]>
2011-07-21T20:57:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28892#p28892 <![CDATA[Re: Custom Capabilities Question]]>
Thanks

Statistics: Posted by fcp2011 — July 21st, 2011, 8:57 pm


]]>
2011-07-21T00:06:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28776#p28776 <![CDATA[Re: Custom Capabilities Question]]> WP Admin -> Users -> Edit user -> s2Member Configuration & Profile Fields -> Custom Capabilities

If you have s2Member Pro, you can edit users in bulk and import them using the Export and Import tools. WP Admin -> s2Member -> Import/Export

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — July 21st, 2011, 12:06 am


]]>
2011-07-20T17:24:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28741#p28741 <![CDATA[Re: Custom Capabilities Question]]> Statistics: Posted by fcp2011 — July 20th, 2011, 5:24 pm


]]>
2011-07-20T14:02:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28726#p28726 <![CDATA[Re: Custom Capabilities Question]]> wp_usermeta/wp_capabilities/.

Statistics: Posted by Cristián Lávaque — July 20th, 2011, 2:02 pm


]]>
2011-07-19T17:01:22-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14172&p=28664#p28664 <![CDATA[Custom Capabilities Question]]>
If I use the paypal shortcode options s2member provides, I can see the ccaps holds my custom capability. Now lets say I want to use a normal html form, or gravity forms to enter my custom capability, how would I accomplish this?

Thanks

Statistics: Posted by fcp2011 — July 19th, 2011, 5:01 pm


]]>