add_rtmedia_meta

Add media meta.

Description

(bool|string) add_rtmedia_meta( (constant) $id = false, (constant) $key = false, (constant) $value = false, (bool) $duplicate = false ); 

Returns (bool|string)

Parameters (4)

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

Usage

  1. if ( !function_exists( 'add_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. // The value. 
  11. $value = false; 
  12.  
  13. // The duplicate. 
  14. $duplicate = false; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = add_rtmedia_meta($id, $key, $value, $duplicate); 
  18.  

Defined (1)

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

/app/main/controllers/template/rtmedia-functions.php  
  1. function add_rtmedia_meta( $id = false, $key = false, $value = false, $duplicate = false ) { 
  2.  
  3. if ( apply_filters( 'rtmedia_use_legacy_meta_function', false ) ) { 
  4. $rtmediameta = new RTMediaMeta( $id, $key, $value, $duplicate ); 
  5.  
  6. return $rtmediameta->add_meta( $id, $key, $value, $duplicate ); 
  7. } else { 
  8. // use WP's default get_metadata function replace column name from "media_id" to "id" in query 
  9.  
  10. $meta = add_metadata( 'media', $id, $key, $value, ! $duplicate ); 
  11.  
  12. remove_filter( 'query', 'rtm_filter_metaid_column_name' ); 
  13.  
  14. return $meta; 
  15.