Changeset 32610
- Timestamp:
- 05/26/2015 07:32:55 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r32331 r32610 19 19 * @global wpdb $wpdb WordPress database abstraction object. 20 20 * 21 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 22 * @param int $object_id ID of the object metadata is for 23 * @param string $meta_key Metadata key 24 * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. 25 * @param bool $unique Optional, default is false. Whether the specified metadata key should be 26 * unique for the object. If true, and the object already has a value for the specified 27 * metadata key, no change will be made 28 * @return int|bool The meta ID on success, false on failure. 21 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 22 * @param int $object_id ID of the object metadata is for 23 * @param string $meta_key Metadata key 24 * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. 25 * @param bool $unique Optional, default is false. 26 * Whether the specified metadata key should be unique for the object. 27 * If true, and the object already has a value for the specified metadata key, 28 * no change will be made. 29 * @return int|false The meta ID on success, false on failure. 29 30 */ 30 31 function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = false) { … … 133 134 * @global wpdb $wpdb WordPress database abstraction object. 134 135 * 135 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)136 * @param int $object_idID of the object metadata is for137 * @param string $meta_key Metadata key138 * @param mixed $meta_value Metadata value. Must be serializable if non-scalar.139 * @param mixed $prev_value Optional. If specified, only update existing metadata entries with140 * the specified value. Otherwise, update all entries.136 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 137 * @param int $object_id ID of the object metadata is for 138 * @param string $meta_key Metadata key 139 * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. 140 * @param mixed $prev_value Optional. If specified, only update existing metadata entries with 141 * the specified value. Otherwise, update all entries. 141 142 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure. 142 143 */ … … 448 449 * 449 450 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 450 * @param int $object_id ID of the object metadata is for 451 * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for 452 * the specified object. 453 * @param bool $single Optional, default is false. If true, return only the first value of the 454 * specified meta_key. This parameter has no effect if meta_key is not specified. 451 * @param int $object_id ID of the object metadata is for 452 * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for 453 * the specified object. 454 * @param bool $single Optional, default is false. 455 * If true, return only the first value of the specified meta_key. 456 * This parameter has no effect if meta_key is not specified. 455 457 * @return mixed Single metadata value, or array of values 456 458 */ … … 519 521 * 520 522 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 521 * @param int $object_id ID of the object metadata is for522 * @param string $meta_key Metadata key.523 * @return bool ean true of the key is set, false if not.523 * @param int $object_id ID of the object metadata is for 524 * @param string $meta_key Metadata key. 525 * @return bool True of the key is set, false if not. 524 526 */ 525 527 function metadata_exists( $meta_type, $object_id, $meta_key ) { … … 556 558 * @since 3.3.0 557 559 * 560 * @global wpdb $wpdb 561 * 558 562 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 559 * @param int $meta_idID for a specific meta row560 * @return object Meta object or false.563 * @param int $meta_id ID for a specific meta row 564 * @return object|false Meta object or false. 561 565 */ 562 566 function get_metadata_by_mid( $meta_type, $meta_id ) { … … 595 599 * @since 3.3.0 596 600 * 597 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 598 * @param int $meta_id ID for a specific meta row 601 * @global wpdb $wpdb 602 * 603 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 604 * @param int $meta_id ID for a specific meta row 599 605 * @param string $meta_value Metadata value 600 * @param string $meta_key Optional, you can provide a meta key to update it606 * @param string $meta_key Optional, you can provide a meta key to update it 601 607 * @return bool True on successful update, false on failure. 602 608 */ … … 686 692 * @since 3.3.0 687 693 * 694 * @global wpdb $wpdb 695 * 688 696 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 689 * @param int $meta_idID for a specific meta row697 * @param int $meta_id ID for a specific meta row 690 698 * @return bool True on successful delete, false on failure. 691 699 */ … … 773 781 * @global wpdb $wpdb WordPress database abstraction object. 774 782 * 775 * @param string $meta_typeType of object metadata is for (e.g., comment, post, or user)776 * @param int|array $object_ids array or comma delimited list of object IDs to update cache for777 * @return mixedMetadata cache for the specified objects, or false on failure.783 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user) 784 * @param int|array $object_ids Array or comma delimited list of object IDs to update cache for 785 * @return array|false Metadata cache for the specified objects, or false on failure. 778 786 */ 779 787 function update_meta_cache($meta_type, $object_ids) { … … 1154 1162 * @param string $primary_id_column ID column for the filtered object in $primary_table. 1155 1163 * @param object $context Optional. The main query object. 1156 * @return array {1164 * @return false|array { 1157 1165 * Array containing JOIN and WHERE SQL clauses to append to the main query. 1158 1166 * … … 1325 1333 * @access public 1326 1334 * 1335 * @global wpdb $wpdb 1336 * 1327 1337 * @param array $clause Query clause, passed by reference. 1328 1338 * @param array $parent_query Parent query array. … … 1579 1589 * 1580 1590 * @param string $type Type of object to get metadata table for (e.g., comment, post, or user) 1581 * @return mixedMetadata table name, or false if no metadata table exists1591 * @return string|false Metadata table name, or false if no metadata table exists 1582 1592 */ 1583 1593 function _get_meta_table($type) { … … 1621 1631 * @since 3.1.3 1622 1632 * 1623 * @param string $meta_key Meta key1624 * @param mixed $meta_value Meta value to sanitize1625 * @param string $meta_type Type of meta1633 * @param string $meta_key Meta key 1634 * @param mixed $meta_value Meta value to sanitize 1635 * @param string $meta_type Type of meta 1626 1636 * @return mixed Sanitized $meta_value 1627 1637 */ … … 1650 1660 * @since 3.3.0 1651 1661 * 1652 * @param string $meta_typeType of meta1653 * @param string $meta_keyMeta key1662 * @param string $meta_type Type of meta 1663 * @param string $meta_key Meta key 1654 1664 * @param string|array $sanitize_callback A function or method to call when sanitizing the value of $meta_key. 1655 * @param string|array $auth_callback Optional. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks.1665 * @param string|array $auth_callback Optional. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks. 1656 1666 */ 1657 1667 function register_meta( $meta_type, $meta_key, $sanitize_callback, $auth_callback = null ) {
Note: See TracChangeset
for help on using the changeset viewer.