_get_meta_table() WordPress Function

The _get_meta_table() function is used to retrieve the name of the table where the metadata for the specified object is stored.

_get_meta_table( string $type ) #

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


Parameters

$type

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


Top ↑

Return

(string|false) Metadata table name, or false if no metadata table exists


Top ↑

Source

File: wp-includes/meta.php

function _get_meta_table( $type ) {
	global $wpdb;

	$table_name = $type . 'meta';

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

	return $wpdb->$table_name;
}


Top ↑

Changelog

Changelog
VersionDescription
2.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.