name ] = $object; } // return return $return; } /** * acfe_get_pretty_post_statuses * * Similar to acf_get_pretty_post_types() but for Post Statuses * * @param array $posts_statuses * * @return array */ function acfe_get_pretty_post_statuses($posts_statuses = array()){ // vars $ref = array(); $return = array(); // get post statuses if(empty($posts_statuses)){ $posts_statuses = get_post_stati(); } // loop foreach($posts_statuses as $post_status){ // vars $object = get_post_status_object($post_status); $label = $object->label; // append to return $return[ $object->name ] = $label; // increase counter if(!isset($ref[ $label ])){ $ref[ $label ] = 0; } $ref[ $label ]++; } // get slugs foreach(array_keys($return) as $slug){ // vars $label = $return[ $slug ]; // append slug if($ref[ $label ] > 1){ $return[ $slug ] .= " ({$slug})"; } } // return return $return; }