_get_meta_table

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

Description

(string|false) _get_meta_table( (string) $type ); 

Returns (string|false)

Metadata table name, or false if no metadata table exists

Parameters (1)

0. $type (string)
Type of object to get metadata table for (e.g., comment, post, or user)

Usage

  1. if ( !function_exists( '_get_meta_table' ) ) { 
  2. require_once ABSPATH . WPINC . '/meta.php'; 
  3.  
  4. // Type of object to get metadata table for (e.g., comment, post, or user) 
  5. $type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _get_meta_table($type); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/meta.php  
  1. function _get_meta_table($type) { 
  2. global $wpdb; 
  3.  
  4. $table_name = $type . 'meta'; 
  5.  
  6. if ( empty($wpdb->$table_name) ) 
  7. return false; 
  8.  
  9. return $wpdb->$table_name;