WordPress.org

Make WordPress Core

Ticket #17013: 17013.2.diff

File 17013.2.diff, 2.7 KB (added by scribu, 7 years ago)

Rename $key to $meta_key

  • wp-includes/post.php

     
    14241424 * @link http://codex.wordpress.org/Function_Reference/get_post_meta
    14251425 *
    14261426 * @param int $post_id Post ID.
    1427  * @param string $key The meta key to retrieve.
     1427 * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
     1428 *              the specified object.
    14281429 * @param bool $single Whether to return a single value.
    14291430 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
    14301431 *  is true.
    14311432 */
    1432 function get_post_meta($post_id, $key, $single = false) {
    1433         return get_metadata('post', $post_id, $key, $single);
     1433function get_post_meta( $post_id, $meta_key = '', $single = false ) {
     1434        return get_metadata( 'post', $post_id, $meta_key, $single );
    14341435}
    14351436
    14361437/**
  • wp-includes/comment.php

     
    527527 * @link http://codex.wordpress.org/Function_Reference/get_comment_meta
    528528 *
    529529 * @param int $comment_id Comment ID.
    530  * @param string $key The meta key to retrieve.
     530 * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
     531 *              the specified object.
    531532 * @param bool $single Whether to return a single value.
    532533 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
    533534 *  is true.
    534535 */
    535 function get_comment_meta($comment_id, $key, $single = false) {
    536         return get_metadata('comment', $comment_id, $key, $single);
     536function get_comment_meta( $comment_id, $meta_key = '', $single = false ) {
     537        return get_metadata( 'comment', $comment_id, $meta_key, $single );
    537538}
    538539
    539540/**
  • wp-includes/user.php

     
    784784 * @link http://codex.wordpress.org/Function_Reference/get_user_meta
    785785 *
    786786 * @param int $user_id Post ID.
    787  * @param string $key The meta key to retrieve.
     787 * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
     788 *              the specified object.
    788789 * @param bool $single Whether to return a single value.
    789790 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
    790791 *  is true.
    791792 */
    792 function get_user_meta($user_id, $key, $single = false) {
    793         return get_metadata('user', $user_id, $key, $single);
     793function get_user_meta( $user_id, $meta_key = '', $single = false ) {
     794        return get_metadata( 'user', $user_id, $meta_key, $single );
    794795}
    795796
    796797/**