• Resolved sqhendr

    (@sqhendr)


    In a plugin, I’ve created a custom content type with capabilities that are designed to be used just for that content type. Everything seems to work fine, but for some reason, I get the following notice error:

    Notice: Undefined offset: 0 in ../wp-includes/capabilities.php on line 1119

    Looking at that line in the code, it looks like perhaps $args is empty. Anyone know why that might be?

    When I save the post, I’m checking editing capability by using “edit_mytype”, rather than “edit_post,” because I wanted to check to ensure that the user has the rights to edit this particular type.

    I’ll be glad to provide any code that might be helpful.

Viewing 1 replies (of 1 total)
  • Thread Starter sqhendr

    (@sqhendr)

    Ok, looks like WordPress doesn’t like post types that are mass nouns rather than count nouns. I had capabilities for which the singular and plural were the same. Thus, the capability type was an array (‘mytype’,’mytype’). I changed it so that it actually has an “s” plural in the capabilities, and it works. It makes my inner grammarian squirm, but it works.

Viewing 1 replies (of 1 total)
  • The topic ‘Undefined offset in custom content type capability’ is closed to new replies.