WordPress Array Helpers: wp_list_pluck, wp_list_filter, and wp_list_sort ...
wp_list_pluck(), wp_list_filter() and wp_list_sort(): array helpers in WordPress WordPress returns lists everywhere: get_posts() gives WP_Post objects, get_terms() gives WP_Term objects, get_users() gives WP_User objects. Getting one field from all of them, keeping some of them or sorting them by a field are everyday tasks, and core has three small functions for them that work with…
Details