REST API: Add support for "integer" type for meta and options

Previously Settings only supported "number" which meant it was possible to push floats to things like posts_per_page. This means now developers can also specify `type => ineger` in meta nad settings resgration.

Props flixos90.
Fixes #38393.

Built from https://develop.svn.wordpress.org/trunk@39058


git-svn-id: http://core.svn.wordpress.org/trunk@39000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe Hoyle
2016-10-31 16:07:31 +00:00
parent 1dd88e334b
commit f1591eccca
4 changed files with 10 additions and 5 deletions

View File

@@ -404,6 +404,9 @@ abstract class WP_REST_Meta_Fields {
case 'string':
$value = (string) $value;
break;
case 'integer':
$value = (int) $value;
break;
case 'number':
$value = (float) $value;
break;