Funky Custom Capabilities issue

I have a user with these custom capabilities defined:


I’m trying to send the user to a welcome page based on custom capabilities:

So he should end up on this page:

But when I login I get sent to:

I tried configuring the user’s custom capabilities with spaces after the commas but they get replaced with underscores:


I tried delimiting the ccaps with hyphens but any non alphanumeric character gets replaced with an underscore. This only happens in the Custom Capabilities field on the edit user page.

I’m really puzzled by this. Thanks.

Hi Rob.

That replacement code gives all the user’s ccaps, not just one. “%%current_user_ccaps%% = The current User’s Custom Capabilities.”

And the underscores are used because it goes in a URL.

I think you’ll have an easier time, and better control, if instead you use a single Login Welcome Page, and change the content in it using conditionals.

Would that work for you? :slight_smile:

I need to have a specific ccap land on a specific welcome page. The page is too complicated to use content shortcodes to show to each group in the ccap. I’ll have to come up with a different solution. Thanks.

You could use a condition for the redirection on the page. Instead of showing different content blocks, you can create a custom redirection. E.g. (not tested)

[s2If current_user_can(access_s2member_ccap_groucho)]