Filter hook 'the_meta_key'

in WP Core File wp-includes/post-template.php at line 1155

View Source

the_meta_key

Filter Hook
Description
Filters the HTML output of the li element in the post custom fields list.

Hook Information

File Location wp-includes/post-template.php View on GitHub
Hook Type Filter
Line Number 1155

Hook Parameters

Type Name Description
string $html The HTML output for the li element.
string $key Meta key.
string $value Meta value.

Usage Examples

Basic Usage
<?php
// Hook into the_meta_key
add_filter('the_meta_key', 'my_custom_filter', 10, 3);

function my_custom_filter($html, $key, $value) {
    // Your custom filtering logic here
    return $html;
}

Source Code Context

wp-includes/post-template.php:1155 - How this hook is used in WordPress core
<?php
1150  			 *
1151  			 * @param string $html  The HTML output for the li element.
1152  			 * @param string $key   Meta key.
1153  			 * @param string $value Meta value.
1154  			 */
1155  			$li_html .= apply_filters( 'the_meta_key', $html, $key, $value );
1156  		}
1157  
1158  		if ( $li_html ) {
1159  			echo "<ul class='post-meta'>\n{$li_html}</ul>\n";
1160  		}

PHP Documentation

<?php
/**
			 * Filters the HTML output of the li element in the post custom fields list.
			 *
			 * @since 2.2.0
			 *
			 * @param string $html  The HTML output for the li element.
			 * @param string $key   Meta key.
			 * @param string $value Meta value.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/post-template.php
Related Hooks

Related hooks will be displayed here in future updates.