/** * Renders an HTML Dropdown of all the Ticket Post Statuses * * @access public * @since 1.0 * @param str $name Name attribute of the dropdown * @param str $selected Status to select automatically * @return str $output Status dropdown */ public function ticket_status_dropdown($name = 'post_status', $selected = 0) { $ticket_statuses = kbs_get_post_statuses('labels', true); $options = array(); foreach ($ticket_statuses as $ticket_status) { $options[$ticket_status->name] = esc_html($ticket_status->label); } $output = $this->select(array('name' => $name, 'selected' => $selected, 'options' => $options, 'show_option_all' => '', 'show_option_none' => false)); return $output; }
/** * Retrieve all ticket statuses. * * @since 1.0 * @return arr */ function kbs_get_ticket_statuses() { $ticket_statuses = kbs_get_post_statuses('labels', true); $statuses = array(); foreach ($ticket_statuses as $ticket_status) { $statuses[$ticket_status->name] = esc_html($ticket_status->label); } return $statuses; }