From 891b76e034f7f74553e2cd57ecd8e3a61352a04f Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 12 Sep 2015 15:46:25 +0000 Subject: [PATCH] `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 --- wp-includes/post-functions.php | 7 ++++--- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-includes/post-functions.php b/wp-includes/post-functions.php index 404d07cc6b..7c0786239a 100644 --- a/wp-includes/post-functions.php +++ b/wp-includes/post-functions.php @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index 58e4443177..efb5ae670b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.