{"action":"created","issue":{"url":"https://api.github.com/repos/herrvigg/qtranslate-x/issues/434","repository_url":"https://api.github.com/repos/herrvigg/qtranslate-x","labels_url":"https://api.github.com/repos/herrvigg/qtranslate-x/issues/434/labels{/name}","comments_url":"https://api.github.com/repos/herrvigg/qtranslate-x/issues/434/comments","events_url":"https://api.github.com/repos/herrvigg/qtranslate-x/issues/434/events","html_url":"https://github.com/herrvigg/qtranslate-x/issues/434","id":335096756,"node_id":"MDU6SXNzdWUzMzUwOTY3NTY=","number":434,"title":"Issue with get_terms() and terms order","user":{"login":"herrvigg","id":19155375,"node_id":"MDQ6VXNlcjE5MTU1Mzc1","avatar_url":"https://avatars2.githubusercontent.com/u/19155375?v=4","gravatar_id":"","url":"https://api.github.com/users/herrvigg","html_url":"https://github.com/herrvigg","followers_url":"https://api.github.com/users/herrvigg/followers","following_url":"https://api.github.com/users/herrvigg/following{/other_user}","gists_url":"https://api.github.com/users/herrvigg/gists{/gist_id}","starred_url":"https://api.github.com/users/herrvigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herrvigg/subscriptions","organizations_url":"https://api.github.com/users/herrvigg/orgs","repos_url":"https://api.github.com/users/herrvigg/repos","events_url":"https://api.github.com/users/herrvigg/events{/privacy}","received_events_url":"https://api.github.com/users/herrvigg/received_events","type":"User","site_admin":false},"labels":[{"id":971679229,"node_id":"MDU6TGFiZWw5NzE2NzkyMjk=","url":"https://api.github.com/repos/herrvigg/qtranslate-x/labels/import","name":"import","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-23T12:28:53Z","updated_at":"2018-06-23T12:28:54Z","closed_at":null,"author_association":"OWNER","body":"<a href=\"https://github.com/dademaru\"><img src=\"https://avatars1.githubusercontent.com/u/1826139?v=4\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [dademaru](https://github.com/dademaru)**\n_Wednesday Sep 28, 2016 at 10:59 GMT_\n_Originally opened as https://github.com/qTranslate-Team/qtranslate-x/issues/434_\n\n----\n\nHi,\n\nI'm having issue ordering terms with `get_terms()` and `orderby` cross languages.\nIf I choose default `orderby => name`, the **order is the same in each language**, due to qTranslateX storing term name tranlsations in **qtranslate_term_name** option.\n\nSince I'm using **qTranslate Slug**, I've then tried to order by terms **meta value**: `_qts_slug_$lang`, which is different for each language.\n\n```\nglobal $q_config;\n$lang_slug = '_qts_slug_'.$q_config['language'];\n$terms = get_terms( array(\n    'taxonomy' => 'custom_taxonomy',\n    'meta_key' , $lang_slug,\n    'orderby'    => 'meta_value',\n));\n```\n\nBut it doesn't work, order is still the same.\nAny idea on how to fix it?\n\nThanks\nDavide\n\n"},"comment":{"url":"https://api.github.com/repos/herrvigg/qtranslate-x/issues/comments/399674130","html_url":"https://github.com/herrvigg/qtranslate-x/issues/434#issuecomment-399674130","issue_url":"https://api.github.com/repos/herrvigg/qtranslate-x/issues/434","id":399674130,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTY3NDEzMA==","user":{"login":"herrvigg","id":19155375,"node_id":"MDQ6VXNlcjE5MTU1Mzc1","avatar_url":"https://avatars2.githubusercontent.com/u/19155375?v=4","gravatar_id":"","url":"https://api.github.com/users/herrvigg","html_url":"https://github.com/herrvigg","followers_url":"https://api.github.com/users/herrvigg/followers","following_url":"https://api.github.com/users/herrvigg/following{/other_user}","gists_url":"https://api.github.com/users/herrvigg/gists{/gist_id}","starred_url":"https://api.github.com/users/herrvigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herrvigg/subscriptions","organizations_url":"https://api.github.com/users/herrvigg/orgs","repos_url":"https://api.github.com/users/herrvigg/repos","events_url":"https://api.github.com/users/herrvigg/events{/privacy}","received_events_url":"https://api.github.com/users/herrvigg/received_events","type":"User","site_admin":false},"created_at":"2018-06-23T12:28:54Z","updated_at":"2018-06-23T12:28:54Z","author_association":"OWNER","body":"<a href=\"https://github.com/dademaru\"><img src=\"https://avatars1.githubusercontent.com/u/1826139?v=4\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [dademaru](https://github.com/dademaru)**\n_Wednesday Oct 05, 2016 at 11:18 GMT_\n\n----\n\nI temporarily solved by sorting the array **outside** `get_terms()`, adding:\n\n```\nusort($terms, function($a, $b) {\n        return strcmp($a->name, $b->name);\n});\n```\n\nBut it would be more appropriate that `'orderby' => 'name'` (or `'orderby'    => 'meta_value'`) worked as expected (especially for taxonomy widgets used by core or other plugins).\nThanks\n\n"}}
{"actor":{"display_login":"herrvigg"}}