_get_meta_table()WP 2.9.0

Retrieves the name of the metadata table for the specified object type.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

String|false. Metadata table name, or false if no metadata table exists

Usage

_get_meta_table( $type );
$type(string) (required)
Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.

Notes

  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 2.9.0 Introduced.

_get_meta_table() code WP 6.6.2

function _get_meta_table( $type ) {
	global $wpdb;

	$table_name = $type . 'meta';

	if ( empty( $wpdb->$table_name ) ) {
		return false;
	}

	return $wpdb->$table_name;
}