Clarify documentation for hooks in `sanitize_post_field()`.
* `edit_post_{$field}` pairs with `edit_{$field}` * `pre_post_{$field}` pairs with `pre_{$field}` * `post_{$field}` pairs with `{$field}` As the above pairs' docs are unnecessarily duplicative, the second sets of docs have been removed. Also, the "duplicates" are purposely not marked as such in this case as the hook names differ. Also remove `@deprecated` tags mistakenly left in in [28041]. See #25376. Built from https://develop.svn.wordpress.org/trunk@28042 git-svn-id: http://core.svn.wordpress.org/trunk@27872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
07ee43d6d0
commit
a55d734f60
|
@ -2011,8 +2011,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
/**
|
/**
|
||||||
* Filter the value of a specific post field to edit.
|
* Filter the value of a specific post field to edit.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, $field, refers to the prefixed
|
* The dynamic portion of the hook name, $field, refers to the post field name.
|
||||||
* post field name. For example, 'post_title'.
|
|
||||||
*
|
*
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
*
|
*
|
||||||
|
@ -2025,29 +2024,15 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
* Filter the value of a specific post field to edit.
|
* Filter the value of a specific post field to edit.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, $field_no_prefix, refers to
|
* The dynamic portion of the hook name, $field_no_prefix, refers to
|
||||||
* the post field name with no prefix. For example, 'title' instead
|
* the post field name.
|
||||||
* of 'post_title'.
|
|
||||||
*
|
*
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
* @deprecated 2.3.0 Use "edit_post_$field" instead.
|
|
||||||
*
|
*
|
||||||
* @param mixed $value Value of the post field.
|
* @param mixed $value Value of the post field.
|
||||||
* @param int $post_id Post ID.
|
* @param int $post_id Post ID.
|
||||||
*/
|
*/
|
||||||
$value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id );
|
$value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter the value of a specific post field to edit.
|
|
||||||
*
|
|
||||||
* The dynamic portion of the hook name, $field, refers to the un-prefixed
|
|
||||||
* post field. For example, 'title' instead of 'post_title'.
|
|
||||||
*
|
|
||||||
* @since 2.3.0
|
|
||||||
*
|
|
||||||
* @param mixed $value Value of the un-prefixed post field.
|
|
||||||
* @param int $post_id Post ID.
|
|
||||||
*/
|
|
||||||
$value = apply_filters( "edit_post_{$field}", $value, $post_id );
|
$value = apply_filters( "edit_post_{$field}", $value, $post_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2063,10 +2048,9 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
if ( $prefixed ) {
|
if ( $prefixed ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the value of a specific field before saving.
|
* Filter the value of a specific post field before saving.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, $field, refers to the
|
* The dynamic portion of the hook name, $field, refers to the post field name.
|
||||||
* prefixed post field name. For example, 'post_title'.
|
|
||||||
*
|
*
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
*
|
*
|
||||||
|
@ -2078,37 +2062,22 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
* Filter the value of a specific field before saving.
|
* Filter the value of a specific field before saving.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, $field_no_prefix, refers
|
* The dynamic portion of the hook name, $field_no_prefix, refers
|
||||||
* to the un-prefixed post field name. For example, 'title' instead
|
* to the post field name.
|
||||||
* of 'post_title'.
|
|
||||||
*
|
*
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
* @deprecated 2.3.0 Use "pre_post_{$field}" instead.
|
|
||||||
*
|
*
|
||||||
* @param mixed $value Value of the post field.
|
* @param mixed $value Value of the post field.
|
||||||
*/
|
*/
|
||||||
$value = apply_filters( "{$field_no_prefix}_save_pre", $value );
|
$value = apply_filters( "{$field_no_prefix}_save_pre", $value );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter the value of a specific field before saving.
|
|
||||||
*
|
|
||||||
* The dynamic portion of the hook name, $field, refers to the un-prefixed
|
|
||||||
* post field name. For example, 'title' instead of 'post_title'.
|
|
||||||
*
|
|
||||||
* @since 2.3.0
|
|
||||||
*
|
|
||||||
* @param mixed $value Value of the post field.
|
|
||||||
*/
|
|
||||||
$value = apply_filters( "pre_post_{$field}", $value );
|
$value = apply_filters( "pre_post_{$field}", $value );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the value of a specific field before saving.
|
* Filter the value of a specific post field before saving.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, $field, refers to the un-prefixed
|
* The dynamic portion of the hook name, $field, refers to the post field name.
|
||||||
* post field name. For example, 'title' instead of 'post_title'.
|
|
||||||
*
|
*
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
* @deprecated 2.3.0 Use "pre_post_{$field}" instead.
|
|
||||||
*
|
*
|
||||||
* @param mixed $value Value of the post field.
|
* @param mixed $value Value of the post field.
|
||||||
*/
|
*/
|
||||||
|
@ -2122,10 +2091,9 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
/**
|
/**
|
||||||
* Filter the value of a specific post field for display.
|
* Filter the value of a specific post field for display.
|
||||||
*
|
*
|
||||||
* The dynamic hook name, $field, refers to the prefixed post field
|
* The dynamic portion of the hook name, $field, refers to the post field name.
|
||||||
* name. For example, 'post_title'.
|
|
||||||
*
|
*
|
||||||
* @since
|
* @since 2.3.0
|
||||||
*
|
*
|
||||||
* @param mixed $value Value of the prefixed post field.
|
* @param mixed $value Value of the prefixed post field.
|
||||||
* @param int $post_id Post ID.
|
* @param int $post_id Post ID.
|
||||||
|
@ -2135,21 +2103,6 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
*/
|
*/
|
||||||
$value = apply_filters( $field, $value, $post_id, $context );
|
$value = apply_filters( $field, $value, $post_id, $context );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter the value of a specific post field for display.
|
|
||||||
*
|
|
||||||
* The dynamic portion of the hook name, $field, refers to the un-prefixed
|
|
||||||
* post field name. For example, 'title' instead of 'post_title'.'
|
|
||||||
*
|
|
||||||
* @since
|
|
||||||
*
|
|
||||||
* @param mixed $value Value of the un-prefixed post field.
|
|
||||||
* @param int $post_id Post ID.
|
|
||||||
* @param string $context Context for how to sanitize the field. Possible
|
|
||||||
* values include 'raw', 'edit', 'db', 'display',
|
|
||||||
* 'attribute' and 'js'.
|
|
||||||
*/
|
|
||||||
$value = apply_filters( "post_{$field}", $value, $post_id, $context );
|
$value = apply_filters( "post_{$field}", $value, $post_id, $context );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue