Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#40318 closed enhancement (fixed)

Document valid `type` parameters in register_meta() arguments

Reported by: iandunn Owned by: rmccue
Priority: normal Milestone: 4.8
Component: Options, Meta APIs Version: 4.7
Severity: minor Keywords: has-patch commit
Cc: Focuses: docs

Description

The valid types aren't documented, so I had to go digging through the source to find them.

The REST API defines them as 'string', 'boolean', 'integer', 'number' in
class-wp-rest-meta-fields.php

I haven't verified that there aren't other valid types used outside the API.

Attachments (2)

40318.diff (812 bytes ) - added by iandunn 9 years ago.
40318.patch (791 bytes ) - added by priyankabehera155 9 years ago.

Download all attachments as: .zip

Change History (9)

@iandunn
9 years ago

#1 @iandunn
9 years ago

  • Keywords has-patch added
  • Severity normalminor

#3 @priyankabehera155
9 years ago

Hi @SergeyBiryukov

Added the valid types for the register_setting() function.

Thank you

#4 @jbpaul17
9 years ago

  • Keywords needs-testing added

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


9 years ago

#6 @rmccue
9 years ago

  • Keywords commit added; needs-testing removed
  • Version4.7

type was only introduced with the REST API in 4.7, so shouldn't be any other valid types outside of this.

Patches look good to me.

#7 @rmccue
9 years ago

  • Owner set to rmccue
  • Resolutionfixed
  • Status newclosed

In 40603:

Options/Meta: Document valid types for registration.

In 4.7, the REST API introduced types for options and meta passed into the registration functions. This adds the documentation for those types.

Props iandunn, priyankabehera155.
Fixes #40318.

Note: See TracTickets for help on using tickets.