WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Term Meta (3 posts)

  1. Dankicity
    Member
    Posted 2 years ago #

    I'm playing around with getting WP_Meta_Query to work with a 'termmeta' table.

    I have it adding $wpdb->termmeta since WP Meta Query looks for the table there like $wpdb->{$meta_type}meta

    $wpdb->termmeta = $wpdb->table_prefix . 'termmeta';
    $wpdb->tables[] = 'termmeta';

    Then I could rip-off the template functions from post.php like:

    function add_term_meta($term_id, $meta_key, $meta_value, $unique = false) {
    	return add_metadata('term', $term_id, $meta_key, $meta_value, $unique);
    }

    and all the rest... except the tricky get_term_custom ones.

    From everything I've looked at in meta.php this should work. Except it's not. Nothings getting inserted/updated.

    Anyone see any issues as to why this wouldn't work.

  2. Dankicity
    Member
    Posted 2 years ago #

    Damn it, why is it only AFTER I spend 4 hours looking for and then trying to solve something that I find the search result I was looking for...

    Taxonomy Meta Plugin

  3. klkl932
    Member
    Posted 2 years ago #

    Submitted this question:$wpdb->termmeta since WP Meta Query looks for the table there like $wpdb->{$meta_type}meta, I thought for a long time, has not been resolved, thank you in get help.
    [link removed]

Topic Closed

This topic has been closed to new replies.

About this Topic