<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[27698] trunk/src/wp-includes/meta.php: Inline documentation for hooks in wp-includes/meta.php.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/27698">27698</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-03-25 08:55:44 +0000 (Tue, 25 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Inline documentation for hooks in wp-includes/meta.php.
Props raamdev and kpdesign.
Fixes <a href="http://core.trac.wordpress.org/ticket/25826">#25826</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesmetaphp">trunk/src/wp-includes/meta.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesmetaphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/meta.php (27697 => 27698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/meta.php 2014-03-25 08:52:22 UTC (rev 27697)
+++ trunk/src/wp-includes/meta.php 2014-03-25 08:55:44 UTC (rev 27698)
</span><span class="lines">@@ -16,8 +16,6 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.9.0
</span><span class="cx"> * @uses $wpdb WordPress database object for queries.
</span><del>- * @uses do_action() Calls 'added_{$meta_type}_meta' with meta_id of added metadata entry,
- * object ID, meta key, and meta value
</del><span class="cx"> *
</span><span class="cx"> * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
</span><span class="cx"> * @param int $object_id ID of the object metadata is for
</span><span class="lines">@@ -47,6 +45,22 @@
</span><span class="cx"> $meta_value = wp_unslash($meta_value);
</span><span class="cx"> $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );
</span><span class="cx">
</span><ins>+ /**
+ * Filter whether to add metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user). Returning a non-null value
+ * will effectively short-circuit the function.
+ *
+ * @since 3.1.0
+ *
+ * @param null|bool $check Whether to allow adding metadata for the given type.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value. Must be serializable if non-scalar.
+ * @param bool $unique Whether the specified meta key should be unique
+ * for the object. Optional. Default false.
+ */
</ins><span class="cx"> $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique );
</span><span class="cx"> if ( null !== $check )
</span><span class="cx"> return $check;
</span><span class="lines">@@ -59,6 +73,18 @@
</span><span class="cx"> $_meta_value = $meta_value;
</span><span class="cx"> $meta_value = maybe_serialize( $meta_value );
</span><span class="cx">
</span><ins>+ /**
+ * Fires immediately before meta of a specific type is added.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user).
+ *
+ * @since 3.1.0
+ *
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><span class="cx"> $result = $wpdb->insert( $table, array(
</span><span class="lines">@@ -74,6 +100,19 @@
</span><span class="cx">
</span><span class="cx"> wp_cache_delete($object_id, $meta_type . '_meta');
</span><span class="cx">
</span><ins>+ /**
+ * Fires immediately after meta of a specific type is added.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user).
+ *
+ * @since 2.9.0
+ *
+ * @param int $mid The meta ID after successful update.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><span class="cx"> return $mid;
</span><span class="lines">@@ -85,10 +124,6 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.9.0
</span><span class="cx"> * @uses $wpdb WordPress database object for queries.
</span><del>- * @uses do_action() Calls 'update_{$meta_type}_meta' before updating metadata with meta_id of
- * metadata entry to update, object ID, meta key, and meta value
- * @uses do_action() Calls 'updated_{$meta_type}_meta' after updating metadata with meta_id of
- * updated metadata entry, object ID, meta key, and meta value
</del><span class="cx"> *
</span><span class="cx"> * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
</span><span class="cx"> * @param int $object_id ID of the object metadata is for
</span><span class="lines">@@ -119,6 +154,23 @@
</span><span class="cx"> $meta_value = wp_unslash($meta_value);
</span><span class="cx"> $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );
</span><span class="cx">
</span><ins>+ /**
+ * Filter whether to update metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user). Returning a non-null value
+ * will effectively short-circuit the function.
+ *
+ * @since 3.1.0
+ *
+ * @param null|bool $check Whether to allow updating metadata for the given type.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value. Must be serializable if non-scalar.
+ * @param mixed $prev_value Optional. If specified, only update existing
+ * metadata entries with the specified value.
+ * Otherwise, update all entries.
+ */
</ins><span class="cx"> $check = apply_filters( "update_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value );
</span><span class="cx"> if ( null !== $check )
</span><span class="cx"> return (bool) $check;
</span><span class="lines">@@ -146,9 +198,32 @@
</span><span class="cx"> $where['meta_value'] = $prev_value;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Fires immediately before updating metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user).
+ *
+ * @since 2.9.0
+ *
+ * @param int $meta_id ID of the metadata entry to update.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><span class="cx"> if ( 'post' == $meta_type )
</span><ins>+ /**
+ * Fires immediately before updating a post's metadata.
+ *
+ * @since 2.9.0
+ *
+ * @param int $meta_id ID of metadata entry to update.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
</span><span class="cx">
</span><span class="cx"> $result = $wpdb->update( $table, $data, $where );
</span><span class="lines">@@ -157,10 +232,34 @@
</span><span class="cx">
</span><span class="cx"> wp_cache_delete($object_id, $meta_type . '_meta');
</span><span class="cx">
</span><ins>+ /**
+ * Fires immediately after updating metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user).
+ *
+ * @since 2.9.0
+ *
+ * @param int $meta_id ID of updated metadata entry.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><del>- if ( 'post' == $meta_type )
</del><ins>+ if ( 'post' == $meta_type ) {
+ /**
+ * Fires immediately after updating a post's metadata.
+ *
+ * @since 2.9.0
+ *
+ * @param int $meta_id ID of updated metadata entry.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -170,8 +269,6 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.9.0
</span><span class="cx"> * @uses $wpdb WordPress database object for queries.
</span><del>- * @uses do_action() Calls 'deleted_{$meta_type}_meta' after deleting with meta_id of
- * deleted metadata entries, object ID, meta key, and meta value
</del><span class="cx"> *
</span><span class="cx"> * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
</span><span class="cx"> * @param int $object_id ID of the object metadata is for
</span><span class="lines">@@ -201,6 +298,23 @@
</span><span class="cx"> $meta_key = wp_unslash($meta_key);
</span><span class="cx"> $meta_value = wp_unslash($meta_value);
</span><span class="cx">
</span><ins>+ /**
+ * Filter whether to delete metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user). Returning a non-null value
+ * will effectively short-circuit the function.
+ *
+ * @since 3.1.0
+ *
+ * @param null|bool $delete Whether to allow metadata deletion of the given type.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value. Must be serializable if non-scalar.
+ * @param bool $delete_all Whether to delete the matching metadata entries
+ * for all objects, ignoring the specified $object_id.
+ * Default false.
+ */
</ins><span class="cx"> $check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all );
</span><span class="cx"> if ( null !== $check )
</span><span class="cx"> return (bool) $check;
</span><span class="lines">@@ -223,11 +337,32 @@
</span><span class="cx"> if ( $delete_all )
</span><span class="cx"> $object_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $type_column FROM $table WHERE meta_key = %s", $meta_key ) );
</span><span class="cx">
</span><ins>+ /**
+ * Fires immediately before deleting metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user).
+ *
+ * @since 3.1.0
+ *
+ * @param array $meta_ids An array of metadata entry IDs to delete.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><span class="cx"> // Old-style action.
</span><del>- if ( 'post' == $meta_type )
</del><ins>+ if ( 'post' == $meta_type ) {
+ /**
+ * Fires immediately before deleting metadata for a post.
+ *
+ * @since 2.9.0
+ *
+ * @param array $meta_ids An array of post metadata entry IDs to delete.
+ */
</ins><span class="cx"> do_action( 'delete_postmeta', $meta_ids );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> $query = "DELETE FROM $table WHERE $id_column IN( " . implode( ',', $meta_ids ) . " )";
</span><span class="cx">
</span><span class="lines">@@ -244,11 +379,32 @@
</span><span class="cx"> wp_cache_delete($object_id, $meta_type . '_meta');
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Fires immediatley after deleting metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user).
+ *
+ * @since 2.9.0
+ *
+ * @param array $meta_ids An array of deleted metadata entry IDs.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param mixed $meta_value Meta value.
+ */
</ins><span class="cx"> do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><span class="cx"> // Old-style action.
</span><del>- if ( 'post' == $meta_type )
</del><ins>+ if ( 'post' == $meta_type ) {
+ /**
+ * Fires immediately after deleting metadata for a post.
+ *
+ * @since 2.9.0
+ *
+ * @param array $meta_ids An array of deleted post metadata entry IDs.
+ */
</ins><span class="cx"> do_action( 'deleted_postmeta', $meta_ids );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -273,6 +429,22 @@
</span><span class="cx"> if ( !$object_id = absint($object_id) )
</span><span class="cx"> return false;
</span><span class="cx">
</span><ins>+ /**
+ * Filter whether to retrieve metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (comment, post, or user). Returning a non-null value
+ * will effectively short-circuit the function.
+ *
+ * @since 3.1.0
+ *
+ * @param null|array|string $value The value get_metadata() should
+ * return - a single metadata value,
+ * or an array of values.
+ * @param int $object_id Object ID.
+ * @param string $meta_key Meta key.
+ * @param string|array $single Meta value, or an array of values.
+ */
</ins><span class="cx"> $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );
</span><span class="cx"> if ( null !== $check ) {
</span><span class="cx"> if ( $single && is_array( $check ) )
</span><span class="lines">@@ -321,6 +493,7 @@
</span><span class="cx"> if ( ! $object_id = absint( $object_id ) )
</span><span class="cx"> return false;
</span><span class="cx">
</span><ins>+ /** This filter is documented in wp-includes/meta.php */
</ins><span class="cx"> $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, true );
</span><span class="cx"> if ( null !== $check )
</span><span class="cx"> return (bool) $check;
</span><span class="lines">@@ -431,10 +604,13 @@
</span><span class="cx"> $where = array();
</span><span class="cx"> $where[$id_column] = $meta_id;
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/meta.php */
</ins><span class="cx"> do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><del>- if ( 'post' == $meta_type )
</del><ins>+ if ( 'post' == $meta_type ) {
+ /** This action is documented in wp-includes/meta.php */
</ins><span class="cx"> do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // Run the update query, all fields in $data are %s, $where is a %d.
</span><span class="cx"> $result = $wpdb->update( $table, $data, $where, '%s', '%d' );
</span><span class="lines">@@ -444,10 +620,13 @@
</span><span class="cx"> // Clear the caches.
</span><span class="cx"> wp_cache_delete($object_id, $meta_type . '_meta');
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/meta.php */
</ins><span class="cx"> do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
</span><span class="cx">
</span><del>- if ( 'post' == $meta_type )
</del><ins>+ if ( 'post' == $meta_type ) {
+ /** This action is documented in wp-includes/meta.php */
</ins><span class="cx"> do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -489,11 +668,23 @@
</span><span class="cx"> if ( $meta = get_metadata_by_mid( $meta_type, $meta_id ) ) {
</span><span class="cx"> $object_id = $meta->{$column};
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/meta.php */
</ins><span class="cx"> do_action( "delete_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );
</span><span class="cx">
</span><span class="cx"> // Old-style action.
</span><del>- if ( 'post' == $meta_type || 'comment' == $meta_type )
</del><ins>+ if ( 'post' == $meta_type || 'comment' == $meta_type ) {
+ /**
+ * Fires immediately before deleting post or comment metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (post or comment).
+ *
+ * @since 3.4.0
+ *
+ * @param int $meta_id ID of the metadata entry to delete.
+ */
</ins><span class="cx"> do_action( "delete_{$meta_type}meta", $meta_id );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // Run the query, will return true if deleted, false otherwise
</span><span class="cx"> $result = (bool) $wpdb->delete( $table, array( $id_column => $meta_id ) );
</span><span class="lines">@@ -501,11 +692,23 @@
</span><span class="cx"> // Clear the caches.
</span><span class="cx"> wp_cache_delete($object_id, $meta_type . '_meta');
</span><span class="cx">
</span><ins>+ /** This action is documented in wp-includes/meta.php */
</ins><span class="cx"> do_action( "deleted_{$meta_type}_meta", (array) $meta_id, $object_id, $meta->meta_key, $meta->meta_value );
</span><span class="cx">
</span><span class="cx"> // Old-style action.
</span><del>- if ( 'post' == $meta_type || 'comment' == $meta_type )
</del><ins>+ if ( 'post' == $meta_type || 'comment' == $meta_type ) {
+ /**
+ * Fires immediately after deleting post or comment metadata of a specific type.
+ *
+ * The dynamic portion of the hook, $meta_type, refers to the meta
+ * object type (post or comment).
+ *
+ * @since 3.4.0
+ *
+ * @param int $meta_ids Deleted metadata entry ID.
+ */
</ins><span class="cx"> do_action( "deleted_{$meta_type}meta", $meta_id );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> return $result;
</span><span class="cx">
</span><span class="lines">@@ -862,6 +1065,22 @@
</span><span class="cx"> if ( ! empty( $join ) )
</span><span class="cx"> $join = ' ' . $join;
</span><span class="cx">
</span><ins>+ /**
+ * Filter the meta query's generated SQL.
+ *
+ * @since 3.1.0
+ *
+ * @param array $args {
+ * An array of arguments.
+ *
+ * @type array $clauses Array containing the query's JOIN and WHERE clauses.
+ * @type array $queries Array of meta queries.
+ * @type string $type Type of meta.
+ * @type string $primary_table Primary table.
+ * @type string $primary_id_column Primary column ID.
+ * @type object $context The main query object.
+ * }
+ */
</ins><span class="cx"> return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $this->queries, $type, $primary_table, $primary_id_column, $context ) );
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -887,7 +1106,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Determine whether a meta key is protected
</del><ins>+ * Determine whether a meta key is protected.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.1.3
</span><span class="cx"> *
</span><span class="lines">@@ -897,11 +1116,20 @@
</span><span class="cx"> function is_protected_meta( $meta_key, $meta_type = null ) {
</span><span class="cx"> $protected = ( '_' == $meta_key[0] );
</span><span class="cx">
</span><ins>+ /**
+ * Filter whether a meta key is protected.
+ *
+ * @since 3.2.0
+ *
+ * @param bool $protected Whether the key is protected. Default false.
+ * @param string $meta_key Meta key.
+ * @param string $meta_type Meta type.
+ */
</ins><span class="cx"> return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Sanitize meta value
</del><ins>+ * Sanitize meta value.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.1.3
</span><span class="cx"> *
</span><span class="lines">@@ -911,6 +1139,20 @@
</span><span class="cx"> * @return mixed Sanitized $meta_value
</span><span class="cx"> */
</span><span class="cx"> function sanitize_meta( $meta_key, $meta_value, $meta_type ) {
</span><ins>+
+ /**
+ * Filter the sanitization of a specific meta key of a specific meta type.
+ *
+ * The dynamic portions of the hook name, $meta_type and $meta_key, refer to the
+ * metadata object type (comment, post, or user) and the meta key value,
+ * respectively.
+ *
+ * @since 3.3.0
+ *
+ * @param mixed $meta_value Meta value to sanitize.
+ * @param string $meta_key Meta key.
+ * @param string $meta_type Meta type.
+ */
</ins><span class="cx"> return apply_filters( "sanitize_{$meta_type}_meta_{$meta_key}", $meta_value, $meta_key, $meta_type );
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>