membership_db_prefix

The Membership 2 membership db prefix function.

Description

membership_db_prefix( &$wpdb, $table, (constant) $useprefix = true ); 

Parameters (3)

0. $wpdb
The wpdb.
1. $table
The table.
2. $useprefix — Optional. (constant) => true
The useprefix.

Usage

  1. if ( !function_exists( 'membership_db_prefix' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/includes/functions.php'; 
  3.  
  4. // The wpdb. 
  5. $wpdb = &$wpdb; 
  6.  
  7. // The table. 
  8. $table = null; 
  9.  
  10. // The useprefix. 
  11. $useprefix = true; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = membership_db_prefix($wpdb, $table, $useprefix); 
  15.  

Defined (1)

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

/app_old/membershipincludes/includes/functions.php  
  1. function membership_db_prefix(&$wpdb, $table, $useprefix = true) { 
  2.  
  3. if($useprefix) { 
  4. $membership_prefix = 'm_'; 
  5. } else { 
  6. $membership_prefix = ''; 
  7.  
  8. if( defined('MEMBERSHIP_GLOBAL_TABLES') && MEMBERSHIP_GLOBAL_TABLES == true ) { 
  9. if(!empty($wpdb->base_prefix)) { 
  10. return $wpdb->base_prefix . $membership_prefix . $table; 
  11. } else { 
  12. return $wpdb->prefix . $membership_prefix . $table; 
  13. } else { 
  14. return $wpdb->prefix . $membership_prefix . $table; 
  15.