{"action":"created","issue":{"url":"https://api.github.com/repos/bainternet/Tax-Meta-Class/issues/121","repository_url":"https://api.github.com/repos/bainternet/Tax-Meta-Class","labels_url":"https://api.github.com/repos/bainternet/Tax-Meta-Class/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/bainternet/Tax-Meta-Class/issues/121/comments","events_url":"https://api.github.com/repos/bainternet/Tax-Meta-Class/issues/121/events","html_url":"https://github.com/bainternet/Tax-Meta-Class/issues/121","id":142985007,"number":121,"title":"Huge bug in latest version of wordpress","user":{"login":"kyoukhana","id":756849,"avatar_url":"https://avatars.githubusercontent.com/u/756849?v=3","gravatar_id":"","url":"https://api.github.com/users/kyoukhana","html_url":"https://github.com/kyoukhana","followers_url":"https://api.github.com/users/kyoukhana/followers","following_url":"https://api.github.com/users/kyoukhana/following{/other_user}","gists_url":"https://api.github.com/users/kyoukhana/gists{/gist_id}","starred_url":"https://api.github.com/users/kyoukhana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyoukhana/subscriptions","organizations_url":"https://api.github.com/users/kyoukhana/orgs","repos_url":"https://api.github.com/users/kyoukhana/repos","events_url":"https://api.github.com/users/kyoukhana/events{/privacy}","received_events_url":"https://api.github.com/users/kyoukhana/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-23T15:02:34Z","updated_at":"2016-03-23T15:17:49Z","closed_at":"2016-03-23T15:17:49Z","body":"When adding new taxonony fields the data is stored in the table wp_termmeta.  Now the issue here is that when trying to retrieve your content it keeps going to the wp_options table which is wrong.  The fix for this is replace **get_tax_meta **function with this code.  This is for the latest version of WordPress \r\n\r\n```\r\n//get term meta field\r\nif (!function_exists('get_tax_meta')){\r\n  function get_tax_meta($term_id,$key,$multi = false){\r\n    global $wpdb;\r\n\r\n    $t_id = (is_object($term_id))? $term_id->term_id: $term_id;\r\n\r\n    $meta = $wpdb->get_var(\"SELECT meta_value FROM wp_termmeta where meta_key='\".$key.\"' AND term_id=\".$t_id);\r\n\r\n    /*Check to see if the string is serialized basically easy check if ther is { not effective way but quick*/\r\n    if (strpos($meta, '{') !== false) {\r\n        $meta = unserialize($meta);\r\n    }\r\n\r\n    if (isset($meta)){\r\n      return $meta;\r\n    }else{\r\n      return '';\r\n    }\r\n  }\r\n}\r\n\r\n````\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bainternet/Tax-Meta-Class/issues/comments/200390031","html_url":"https://github.com/bainternet/Tax-Meta-Class/issues/121#issuecomment-200390031","issue_url":"https://api.github.com/repos/bainternet/Tax-Meta-Class/issues/121","id":200390031,"user":{"login":"bainternet","id":660572,"avatar_url":"https://avatars.githubusercontent.com/u/660572?v=3","gravatar_id":"","url":"https://api.github.com/users/bainternet","html_url":"https://github.com/bainternet","followers_url":"https://api.github.com/users/bainternet/followers","following_url":"https://api.github.com/users/bainternet/following{/other_user}","gists_url":"https://api.github.com/users/bainternet/gists{/gist_id}","starred_url":"https://api.github.com/users/bainternet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bainternet/subscriptions","organizations_url":"https://api.github.com/users/bainternet/orgs","repos_url":"https://api.github.com/users/bainternet/repos","events_url":"https://api.github.com/users/bainternet/events{/privacy}","received_events_url":"https://api.github.com/users/bainternet/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T15:17:49Z","updated_at":"2016-03-23T15:17:49Z","body":"You and I have different definitions of \"Huge bug\".\r\n\r\nsince WordPress 4.4 there is an api for term meta and is should be used, meaning use native\r\n`*_term_meta` functions instead of this class `*_tax_meta` functions\r\n\r\nif you still want to use the \"old\"  `*_tax_meta` functions you can by simply including the provided 'migration/tax_to_term_meta.php' file which will overwrite the `*_tax_meta` functions to be wrappers for the native `*_term_meta` functions.\r\n\r\nalso in that file there is a small class called `tax_to_term_meta` which is there to help you migrate your data from options table to term meta.\r\n\r\n\r\nread the inline documentation of the migration https://github.com/bainternet/Tax-Meta-Class/blob/master/Tax-meta-class%2Fmigration%2Ftax_to_term_meta.php"}}