/** * 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'; }
/** * 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'; }
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'; }