WPAS_Tickets_List::hide_closed_tickets PHP Method

hide_closed_tickets() public method

If the plugin is set to hide closed tickets, we modify the "All Tickets" link in the post type menu and append the status filter with the "open" value.
Since: 3.0.0
public hide_closed_tickets ( ) : boolean
return boolean True if the closed tickets were hiddne, false otherwise
    public function hide_closed_tickets()
    {
        $hide = (bool) wpas_get_option('hide_closed');
        if (true !== $hide) {
            return false;
        }
        global $submenu;
        if (is_array($submenu) && array_key_exists('edit.php?post_type=ticket', $submenu) && isset($submenu[5])) {
            $submenu["edit.php?post_type=ticket"][5][2] = $submenu["edit.php?post_type=ticket"][5][2] . '&wpas_status=open';
        }
        return true;
    }