Created
December 10, 2015 19:16
-
-
Save aiiddqd/c4a4dab58f1688fc50c3 to your computer and use it in GitHub Desktop.
получает term_id категории продуктов WC по значению метаполя
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//получает term_id категории продуктов WC по значению метаполя | |
//Возвращает значение term_id для uuid | |
// $term_id = get_term_id_by_uuid_mss($uuid); | |
function get_term_id_by_uuid_mss($uuid){ | |
global $wpdb; | |
$data = $wpdb->get_results("SELECT term_id FROM $wpdb->termmeta WHERE meta_value = '" . $uuid . "' LIMIT 1"); | |
$data = $data[0]->term_id; | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment