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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user