Skip to content

Determine what goes in Ability meta #106

@JasonTheAdams

Description

@JasonTheAdams

The wp_register_ability() function has an array $args parameter. This includes data that is required and optional. It also has an $args['meta'] array. The entire $args shape is part of the function signature, so changing it is changing the signature of the function. As such, we should be clear and have a rule for what should be a root element of $args, versus what should belong in $args['meta'].

I propose these rules:

  • Required data goes in $args root (e.g. $args['label'])
  • Optional data goes in $meta which itself is optional

This is consistent with the parameters as documented.

As such, this would effect things like annotations and show_in_rest, which will become meta. As a note, meta is also the encouraged location for any further arbitrary data extended by developers — which will also be optional at least as far as registration is concerned.

Metadata

Metadata

Assignees

Labels

Projects

Status

Needs review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions