public function sortAdminColumns($vars)
    {
        if (!isset($vars['orderby'])) {
            return $vars;
        }

        $admin_columns = $this->getAdminColumns();
        if (!Arr::iterable($admin_columns)) {
            return $vars;
        }

        foreach ($admin_columns as $k) {
            if ($vars['orderby'] !== $k) {
                continue;
            }

            $vars = array_merge($vars, array(
                'meta_key'=> $k,
                'orderby' => 'meta_value'
            ));

            break;
        }
        return $vars;
    }
public function sortAdminColumns($vars)
    {
        if (!isset($vars['orderby'])) {
            return $vars;
        }

        $admin_columns = $this->getAdminColumns();
        if (!Arr::iterable($admin_columns)) {
            return $vars;
        }

        foreach ($admin_columns as $k) {
            if ($vars['orderby'] !== $k) {
                continue;
            }

            $vars = array_merge($vars, array(
                'meta_key'=> $k,
                'orderby' => 'meta_value'
            ));

            break;
        }
        return $vars;
    }
public function sortAdminColumns ( $ vars ) { if ( ! isset ( $ vars [ 'orderby' ] ) ) { return $ vars ; } $ admin_columns = $ this -> getAdminColumns ( ) ; if ( ! Arr :: iterable ( $ admin_columns ) ) { return $ vars ; } foreach ( $ admin_columns as $ k ) { if ( $ vars [ 'orderby' ] !== $ k ) { continue ; } $ vars = array_merge ( $ vars , array ( 'meta_key' => $ k , 'orderby' => 'meta_value' ) ) ; break ; } return $ vars ; }
Sort the admin columns if necessary
@param array $vars
@return array
Sort the admin columns if necessary