Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    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.

    Thread Starter slimandslam

    (@slimandslam)

    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

    Plugin Author Vladimir Garagulya

    (@shinephp)

    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.

    Thread Starter slimandslam

    (@slimandslam)

    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

    Plugin Author Vladimir Garagulya

    (@shinephp)

    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.

    Thread Starter slimandslam

    (@slimandslam)

    Thanks!

    J

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: User Role Editor] Can't Add New Capability’ is closed to new replies.