Example #1
0
/**
 * Setup the termmeta table
 *
 * Use <code>add_theme_support( 'term-meta' );</code> to enable support for term meta 
 */
function hm_add_term_meta_table()
{
    global $wpdb;
    if (!current_theme_supports('term-meta') || defined('WP_INSTALLING')) {
        return false;
    }
    hm_create_term_meta_table();
    $wpdb->tables[] = 'termmeta';
    $wpdb->termmeta = $wpdb->prefix . 'termmeta';
}
Example #2
0
/**
 * Hook in on init and setup the termmeta table
 */
function hm_add_term_meta_table()
{
    global $wpdb;
    if (!current_theme_supports('term-meta')) {
        return;
    }
    // Create the table if it doesn't already exist
    hm_create_term_meta_table();
    $wpdb->tables[] = 'termmeta';
    $wpdb->termmeta = $wpdb->prefix . 'termmeta';
}
Example #3
0
function hm_add_term_meta_table()
{
    global $wpdb;
    if (!current_theme_supports('term-meta')) {
        return false;
    }
    //only creates if needed
    hm_create_term_meta_table();
    $wpdb->tables[] = 'termmeta';
    $wpdb->termmeta = $wpdb->prefix . 'termmeta';
}