{"id":1060,"date":"2020-08-14T14:59:52","date_gmt":"2020-08-14T14:59:52","guid":{"rendered":"https:\/\/html5-chat.com\/blog\/?p=1060"},"modified":"2020-08-14T14:59:54","modified_gmt":"2020-08-14T14:59:54","slug":"how-to-sort-users-by-role","status":"publish","type":"post","link":"https:\/\/html5-chat.com\/blog\/how-to-sort-users-by-role\/","title":{"rendered":"How to sort users by role ?"},"content":{"rendered":"\n<p>It is now possible to sort user by role. <br>ex: you need admin to be displayed before moderators, then users then guests.<\/p>\n\n\n\n<p>In your config panel, choose config, under tab &#8220;users&#8221; you can now choose: sorting by <strong>role-power<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"159\" src=\"https:\/\/html5-chat.com\/blog\/wp-content\/uploads\/2020\/08\/sorting.png\" alt=\"\" class=\"wp-image-1061\" srcset=\"https:\/\/html5-chat.com\/blog\/wp-content\/uploads\/2020\/08\/sorting.png 615w, https:\/\/html5-chat.com\/blog\/wp-content\/uploads\/2020\/08\/sorting-300x78.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><figcaption>Sorting users by role-power<\/figcaption><\/figure>\n\n\n\n<p>Then you just need to click the role sorting button in your chat and users will be ordered by their roles.<\/p>\n\n\n\n<p>Notice that you can define what role should be displayed in priority: roles have &#8220;power&#8221; property (you can find that in roles in you chat panel). Ex: admin has role of 9 (high priority) and guest has role of 0 (low priority). You can change these priorities by editing the power field.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"319\" height=\"110\" src=\"https:\/\/html5-chat.com\/blog\/wp-content\/uploads\/2020\/08\/sortRole.png\" alt=\"\" class=\"wp-image-1062\" srcset=\"https:\/\/html5-chat.com\/blog\/wp-content\/uploads\/2020\/08\/sortRole.png 319w, https:\/\/html5-chat.com\/blog\/wp-content\/uploads\/2020\/08\/sortRole-300x103.png 300w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><figcaption>Sorting by role button on the chat<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>It is now possible to sort user by role. ex: you need admin to be displayed before moderators, then users then guests. In your config panel, choose config, under tab &#8220;users&#8221; you can now choose: sorting by role-power Then you just need to click the role sorting button in your chat and users will be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1064,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[174],"class_list":["post-1060","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-features","tag-order"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/1060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/comments?post=1060"}],"version-history":[{"count":2,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/1060\/revisions"}],"predecessor-version":[{"id":1065,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/1060\/revisions\/1065"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/media\/1064"}],"wp:attachment":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/media?parent=1060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/categories?post=1060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/tags?post=1060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}