Changing custom capibilities with php or built-in function

i am searching for a way to change users custom capabilities with php. looking at https://s2member.com/kb-article/rolescapabilities-via-php/ seems changing rolls is pretty straightforward with $user->add_cap and $user->remove_cap but i dont see anything specifically for custom capabilities. is there something similar for ccaps?

i have done this with the Pro API For Remote Operations but seeing how this will be from within a wordpress plugin, using that option does not make sense.

thank you.

Sean

Sean (@seancon1),

You should be able to manage CCAPs using $user->add_cap/remove_cap. A CCAP is just a capability. The CCAP will be named like this: access_s2member_ccap_test where test is the name of the CCAP.

1 Like

got it, that works. somehow i missed the connection.

1 Like

Great to hear that it works.