I18N: Allow for post custom field name in the_meta()
to be translated, e.g. to insert a non-breaking space before the colon.
Props audrasjb, johnbillion. Fixes #41653. git-svn-id: https://develop.svn.wordpress.org/trunk@41583 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5346347de7
commit
97564616e1
@ -1018,11 +1018,19 @@ function the_meta() {
|
|||||||
if ( $keys = get_post_custom_keys() ) {
|
if ( $keys = get_post_custom_keys() ) {
|
||||||
echo "<ul class='post-meta'>\n";
|
echo "<ul class='post-meta'>\n";
|
||||||
foreach ( (array) $keys as $key ) {
|
foreach ( (array) $keys as $key ) {
|
||||||
$keyt = trim($key);
|
$keyt = trim( $key );
|
||||||
if ( is_protected_meta( $keyt, 'post' ) )
|
if ( is_protected_meta( $keyt, 'post' ) ) {
|
||||||
continue;
|
continue;
|
||||||
$values = array_map('trim', get_post_custom_values($key));
|
}
|
||||||
$value = implode($values,', ');
|
|
||||||
|
$values = array_map( 'trim', get_post_custom_values( $key ) );
|
||||||
|
$value = implode( $values, ', ' );
|
||||||
|
|
||||||
|
$html = sprintf( "<li><span class='post-meta-key'>%s</span> %s</li>\n",
|
||||||
|
/* translators: %s: Post custom field name */
|
||||||
|
sprintf( _x( '%s:', 'Post custom field name' ), $key ),
|
||||||
|
$value
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters the HTML output of the li element in the post custom fields list.
|
* Filters the HTML output of the li element in the post custom fields list.
|
||||||
@ -1033,7 +1041,7 @@ function the_meta() {
|
|||||||
* @param string $key Meta key.
|
* @param string $key Meta key.
|
||||||
* @param string $value Meta value.
|
* @param string $value Meta value.
|
||||||
*/
|
*/
|
||||||
echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value );
|
echo apply_filters( 'the_meta_key', $html, $key, $value );
|
||||||
}
|
}
|
||||||
echo "</ul>\n";
|
echo "</ul>\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user