`sanitize_post()`: the default value for `$context` is 'display'. The documentation says the default for `sanitize_post_field()` is 'display', but there is no default for the arg. Make the argument: `$context = 'default'`.

Props morganestes.
Fixes #33117.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-12 15:46:25 +00:00
parent 0b412d3333
commit 891b76e034
2 changed files with 5 additions and 4 deletions

View File

@ -1835,15 +1835,16 @@ function sanitize_post( $post, $context = 'display' ) {
* are treated like 'display' when calling filters.
*
* @since 2.3.0
* @since 4.4.0 Like `sanitize_post()`, `$context` defaults to 'display'.
*
* @param string $field The Post Object field name.
* @param mixed $value The Post Object value.
* @param int $post_id Post ID.
* @param string $context How to sanitize post fields. Looks for 'raw', 'edit',
* 'db', 'display', 'attribute' and 'js'.
* @param string $context Optional. How to sanitize post fields. Looks for 'raw', 'edit',
* 'db', 'display', 'attribute' and 'js'. Default 'display'.
* @return mixed Sanitized value.
*/
function sanitize_post_field($field, $value, $post_id, $context) {
function sanitize_post_field( $field, $value, $post_id, $context = 'display' ) {
$int_fields = array('ID', 'post_parent', 'menu_order');
if ( in_array($field, $int_fields) )
$value = (int) $value;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34080';
$wp_version = '4.4-alpha-34081';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.