Try ‘month12’ and you will get success with it. URE checks that capability name be valid programming language identifier, that is starts from the letter, not from the digit.
Hi Vladimir,
I don’t understand. A custom capability identifier is just a string, not a
programming language identifier, right? I can create the custom capability string
“12month” and store it just like any other string. Why would it need to
be a programming language identifier?
Jason
Hi Jason,
Possibly you are right, and such limitation could be seen as excessive or redundant.
I followed existing WordPress standard capabilities names when wrote user input validation rool for capabilities names, as for the roles names too. You can discover that URE doesn’t allow to input role names with spaces inside. You never know where it could fire, in WordPress version 3.5 or 4.1. Just see that standard WP capabilities is not started from digits, and doesn’t contain spaces or hyphens inside, etc. That’s why I consider to not allow extend that.
Regards,
Vladimir.
Hi Vladimir,
Not allowing spaces makes perfect sense.
However, as you can see from the WordPress add_cap() function,
custom capabilities in WordPress are just strings:
http://codex.wordpress.org/Function_Reference/add_cap
So, it’s reasonable to allow any combination of numbers, upper-case letters, and lower-case letters.
Please update your plugin accordingly.
Thanks,
J
Hi Jason,
Try version 3.7. I allowed to use any combination of letters, digits, hyphens and underscores for role and capability names.
Regards,
Vladimir.