Make WordPress Core

Ticket #41653: 41653.3.diff

File 41653.3.diff, 1.3 KB (added by SergeyBiryukov, 6 years ago)
  • src/wp-includes/post-template.php

     
    10181018        if ( $keys = get_post_custom_keys() ) {
    10191019                echo "<ul class='post-meta'>\n";
    10201020                foreach ( (array) $keys as $key ) {
    1021                         $keyt = trim($key);
    1022                         if ( is_protected_meta( $keyt, 'post' ) )
     1021                        $keyt = trim( $key );
     1022                        if ( is_protected_meta( $keyt, 'post' ) ) {
    10231023                                continue;
    1024                         $values = array_map('trim', get_post_custom_values($key));
    1025                         $value = implode($values,', ');
     1024                        }
    10261025
     1026                        $values = array_map( 'trim', get_post_custom_values( $key ) );
     1027                        $value = implode( $values, ', ' );
     1028
     1029                        $html = sprintf( "<li><span class='post-meta-key'>%s</span> %s</li>\n",
     1030                                /* translators: %s: Post custom field name */
     1031                                sprintf( _x( '%s:', 'Post custom field name' ), $key ),
     1032                                $value
     1033                        );
     1034
    10271035                        /**
    10281036                         * Filters the HTML output of the li element in the post custom fields list.
    10291037                         *
     
    10331041                         * @param string $key   Meta key.
    10341042                         * @param string $value Meta value.
    10351043                         */
    1036                         echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value );
     1044                        echo apply_filters( 'the_meta_key', $html, $key, $value );
    10371045                }
    10381046                echo "</ul>\n";
    10391047        }