mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Docs: Synchronize parameter documentation for various metadata functions, update per the documentation standards.
See #49572. git-svn-id: https://develop.svn.wordpress.org/trunk@47611 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -447,10 +447,11 @@ function get_comment_count( $post_id = 0 ) {
|
||||
* @since 2.9.0
|
||||
* @link https://developer.wordpress.org/reference/functions/add_comment_meta/
|
||||
*
|
||||
* @param int $comment_id Comment ID.
|
||||
* @param string $meta_key Metadata name.
|
||||
* @param mixed $meta_value Metadata value.
|
||||
* @param bool $unique Optional. Whether the same key should not be added. Default false.
|
||||
* @param int $comment_id Comment ID.
|
||||
* @param string $meta_key Metadata name.
|
||||
* @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
|
||||
* @param bool $unique Optional. Whether the same key should not be added.
|
||||
* Default false.
|
||||
* @return int|bool Meta ID on success, false on failure.
|
||||
*/
|
||||
function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false ) {
|
||||
@@ -467,9 +468,11 @@ function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false
|
||||
* @since 2.9.0
|
||||
* @link https://developer.wordpress.org/reference/functions/delete_comment_meta/
|
||||
*
|
||||
* @param int $comment_id comment ID
|
||||
* @param string $meta_key Metadata name.
|
||||
* @param mixed $meta_value Optional. Metadata value.
|
||||
* @param int $comment_id Comment ID.
|
||||
* @param string $meta_key Metadata name.
|
||||
* @param mixed $meta_value Optional. Metadata value. If provided,
|
||||
* rows will only be removed that match the value.
|
||||
* Must be serializable if non-scalar. Default empty.
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
|
||||
@@ -482,11 +485,14 @@ function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) {
|
||||
* @since 2.9.0
|
||||
* @link https://developer.wordpress.org/reference/functions/get_comment_meta/
|
||||
*
|
||||
* @param int $comment_id Comment ID.
|
||||
* @param string $key Optional. The meta key to retrieve. By default, returns data for all keys.
|
||||
* @param bool $single Optional. Whether to return a single value. Default false.
|
||||
* @return mixed Will be an array if $single is false. Will be value of meta data field if $single
|
||||
* is true.
|
||||
* @param int $comment_id Comment ID.
|
||||
* @param string $key Optional. The meta key to retrieve. By default,
|
||||
* returns data for all keys.
|
||||
* @param bool $single Optional. Whether to return a single value.
|
||||
* This parameter has no effect if $key is not specified.
|
||||
* Default false.
|
||||
* @return mixed An array if $single is false. The value of meta data field
|
||||
* if $single is true.
|
||||
*/
|
||||
function get_comment_meta( $comment_id, $key = '', $single = false ) {
|
||||
return get_metadata( 'comment', $comment_id, $key, $single );
|
||||
@@ -503,11 +509,13 @@ function get_comment_meta( $comment_id, $key = '', $single = false ) {
|
||||
* @since 2.9.0
|
||||
* @link https://developer.wordpress.org/reference/functions/update_comment_meta/
|
||||
*
|
||||
* @param int $comment_id Comment ID.
|
||||
* @param string $meta_key Metadata key.
|
||||
* @param mixed $meta_value Metadata value.
|
||||
* @param mixed $prev_value Optional. Previous value to check before updating. Default empty.
|
||||
* @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
|
||||
* @param int $comment_id Comment ID.
|
||||
* @param string $meta_key Metadata key.
|
||||
* @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
|
||||
* @param mixed $prev_value Optional. Previous value to check before updating.
|
||||
* Default empty.
|
||||
* @return int|bool Meta ID if the key didn't exist, true on successful update,
|
||||
* false on failure.
|
||||
*/
|
||||
function update_comment_meta( $comment_id, $meta_key, $meta_value, $prev_value = '' ) {
|
||||
return update_metadata( 'comment', $comment_id, $meta_key, $meta_value, $prev_value );
|
||||
|
||||
Reference in New Issue
Block a user