Tribe__Events__Pro__Editor__Meta::get_value( int $post_id, string $meta_key = '' )
Return the meta value of a post ID directly from the DB
Contents
Parameters
- $post_id
-
(int) (Required)
- $meta_key
-
(string) (Optional)
Default value: ''
Return
(mixed)
Source
File: src/Tribe/Editor/Meta.php
public function get_value( $post_id = 0, $meta_key = '' ) {
global $wpdb;
$query = "SELECT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s";
return $wpdb->get_var( $wpdb->prepare( $query, $post_id, $meta_key ) );
}
Changelog
| Version | Description |
|---|---|
| 4.5 | Introduced. |