This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Only allow custom meta of types string, number and boolean#2850
Open
Only allow custom meta of types string, number and boolean#2850
Conversation
Currently we handle registering meta even if your register the type as anything other than `boolean` `number` and `string`, however we don't currently have great ways to handle non-scaler meta. For now, let's whitelist these types and throw a `doing_it_wrong` if meta is registered with an invalid type.
Contributor
|
How do we handle namespacing of objects in meta? e.g., if I'm an seo plugin and I have a "score" meta value, but there's also a keyword-bingo plugin that also has a "score," and I only have a numeric meta field to put them in -- not an object -- how do I ensure there won't be a conflict? |
kadamwhite
reviewed
Oct 17, 2016
| ); | ||
| } | ||
| } else { | ||
| if ( ! in_array( $rest_args['schema']['type'], array( 'number', 'string', 'boolean' ), true ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently we handle registering meta even if your register the type as
anything other than
booleannumberandstring, however we don'tcurrently have great ways to handle non-scaler meta. For now, let's
whitelist these types and throw a
doing_it_wrongif meta is registeredwith an invalid type.