get_rtmedia_meta

Get meta data of media.

Description

get_rtmedia_meta( (constant) $id = false, (bool) $key = false ); 

Parameters (2)

0. $id — Optional. (constant) => false
The id.
1. $key — Optional. (bool) => false
The key.

Usage

  1. if ( !function_exists( 'get_rtmedia_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'rtmedia-for-wordpress-buddypress-and-bbpress/app/main/controllers/template/rtmedia-functions.php'; 
  3.  
  4. // The id. 
  5. $id = false; 
  6.  
  7. // The key. 
  8. $key = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = get_rtmedia_meta($id, $key); 
  12.  

Defined (1)

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

/app/main/controllers/template/rtmedia-functions.php  
  1. function get_rtmedia_meta( $id = false, $key = false ) { 
  2.  
  3. if ( apply_filters( 'rtmedia_use_legacy_meta_function', false ) ) { 
  4. $rtmediameta = new RTMediaMeta(); 
  5.  
  6. return $rtmediameta->get_meta( $id, $key ); 
  7. } else { 
  8. // check whether to get single value or multiple 
  9. $single = ( false === $key ) ? false : true; 
  10.  
  11. // use WP's default get_metadata function replace column name from "media_id" to "id" in query 
  12.  
  13. $meta = get_metadata( 'media', $id, $key, $single ); 
  14.  
  15. remove_filter( 'query', 'rtm_filter_metaid_column_name' ); 
  16.  
  17. return $meta; 
  18.