diff --git src/wp-includes/meta.php src/wp-includes/meta.php
index 0d4eabe1ad..8c042d4c82 100644
|
|
function is_protected_meta( $meta_key, $meta_type = null ) { |
1059 | 1059 | * |
1060 | 1060 | * @param string $meta_key Meta key. |
1061 | 1061 | * @param mixed $meta_value Meta value to sanitize. |
1062 | | * @param string $object_type Type of object the meta is registered to. |
| 1062 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1063 | * (e.g. comment, post, term, user, my_custom_meta) |
1063 | 1064 | * @param string $object_subtype Optional. The subtype of the object type. |
1064 | 1065 | * |
1065 | 1066 | * @return mixed Sanitized $meta_value. |
… |
… |
function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = |
1078 | 1079 | * |
1079 | 1080 | * @param mixed $meta_value Meta value to sanitize. |
1080 | 1081 | * @param string $meta_key Meta key. |
1081 | | * @param string $object_type Object type. |
| 1082 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1083 | * (e.g. comment, post, term, user, my_custom_meta) |
1082 | 1084 | * @param string $object_subtype Object subtype. |
1083 | 1085 | */ |
1084 | 1086 | return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $meta_value, $meta_key, $object_type, $object_subtype ); |
… |
… |
function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = |
1095 | 1097 | * |
1096 | 1098 | * @param mixed $meta_value Meta value to sanitize. |
1097 | 1099 | * @param string $meta_key Meta key. |
1098 | | * @param string $object_type Object type. |
| 1100 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1101 | * (e.g. comment, post, term, user, my_custom_meta) |
1099 | 1102 | */ |
1100 | 1103 | return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type ); |
1101 | 1104 | } |
… |
… |
function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = |
1117 | 1120 | * @since 4.9.8 The `$object_subtype` argument was added to the arguments array. |
1118 | 1121 | * @since 5.3.0 Valid meta types expanded to include "array" and "object". |
1119 | 1122 | * |
1120 | | * @param string $object_type Type of object this meta is registered to. |
| 1123 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1124 | * (e.g. comment, post, term, user, my_custom_meta) |
1121 | 1125 | * @param string $meta_key Meta key to register. |
1122 | 1126 | * @param array $args { |
1123 | 1127 | * Data used to describe the meta key when registered. |
… |
… |
function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { |
1186 | 1190 | * |
1187 | 1191 | * @param array $args Array of meta registration arguments. |
1188 | 1192 | * @param array $defaults Array of default arguments. |
1189 | | * @param string $object_type Object type. |
| 1193 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1194 | * (e.g. comment, post, term, user, my_custom_meta) |
1190 | 1195 | * @param string $meta_key Meta key. |
1191 | 1196 | */ |
1192 | 1197 | $args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key ); |
… |
… |
function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { |
1247 | 1252 | * @since 4.6.0 |
1248 | 1253 | * @since 4.9.8 The `$object_subtype` parameter was added. |
1249 | 1254 | * |
1250 | | * @param string $object_type The type of object. |
| 1255 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1256 | * (e.g. comment, post, term, user, my_custom_meta) |
1251 | 1257 | * @param string $meta_key The meta key. |
1252 | 1258 | * @param string $object_subtype Optional. The subtype of the object type. |
1253 | 1259 | * |
… |
… |
function registered_meta_key_exists( $object_type, $meta_key, $object_subtype = |
1266 | 1272 | * @since 4.6.0 |
1267 | 1273 | * @since 4.9.8 The `$object_subtype` parameter was added. |
1268 | 1274 | * |
1269 | | * @param string $object_type The type of object. |
| 1275 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1276 | * (e.g. comment, post, term, user, my_custom_meta) |
1270 | 1277 | * @param string $meta_key The meta key. |
1271 | 1278 | * @param string $object_subtype Optional. The subtype of the object type. |
1272 | 1279 | * @return bool True if successful. False if the meta key was not registered. |
… |
… |
function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) { |
1315 | 1322 | * @since 4.6.0 |
1316 | 1323 | * @since 4.9.8 The `$object_subtype` parameter was added. |
1317 | 1324 | * |
1318 | | * @param string $object_type The type of object. Post, comment, user, term. |
| 1325 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1326 | * (e.g. comment, post, term, user, my_custom_meta) |
1319 | 1327 | * @param string $object_subtype Optional. The subtype of the object type. |
1320 | 1328 | * @return string[] List of registered meta keys. |
1321 | 1329 | */ |
… |
… |
function get_registered_meta_keys( $object_type, $object_subtype = '' ) { |
1337 | 1345 | * |
1338 | 1346 | * @since 4.6.0 |
1339 | 1347 | * |
1340 | | * @param string $object_type Type of object to request metadata for. (e.g. comment, post, term, user) |
| 1348 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1349 | * (e.g. comment, post, term, user, my_custom_meta) |
1341 | 1350 | * @param int $object_id ID of the object the metadata is for. |
1342 | 1351 | * @param string $meta_key Optional. Registered metadata key. If not specified, retrieve all registered |
1343 | 1352 | * metadata for the specified object. |
… |
… |
function _wp_register_meta_args_whitelist( $args, $default_args ) { |
1399 | 1408 | * |
1400 | 1409 | * @since 4.9.8 |
1401 | 1410 | * |
1402 | | * @param string $object_type Type of object to request metadata for. (e.g. comment, post, term, user) |
| 1411 | * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table. |
| 1412 | * (e.g. comment, post, term, user, my_custom_meta) |
1403 | 1413 | * @param int $object_id ID of the object to retrieve its subtype. |
1404 | 1414 | * @return string The object subtype or an empty string if unspecified subtype. |
1405 | 1415 | */ |