_get_meta_table

函式
_get_meta_table ( $type )
引數
  • (string) $type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.
    Required:
返回值
  • (string|false) Metadata table name, or false if no metadata table exists
定義位置
相關方法
_get_list_tableget_metadataget_meta_sqlget_media_statesget_meta_keys
引入
2.9.0
棄用
-

_get_meta_table: 這是一個用來獲取特定資料庫表的元表名稱的函式。它接收一個資料庫表名作為引數,並返回元表的名稱。

為指定的物件型別檢索後設資料表的名稱。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _get_meta_table( $type ) {
global $wpdb;
$table_name = $type . 'meta';
if ( empty( $wpdb->$table_name ) ) {
return false;
}
return $wpdb->$table_name;
}
function _get_meta_table( $type ) { global $wpdb; $table_name = $type . 'meta'; if ( empty( $wpdb->$table_name ) ) { return false; } return $wpdb->$table_name; }
function _get_meta_table( $type ) {
	global $wpdb;

	$table_name = $type . 'meta';

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

	return $wpdb->$table_name;
}

常見問題

FAQs
檢視更多 >