add sort criteria to columns joined to query
Merge pull request #2371 from opf/hotfix/wp_sorting_by_not_selected_column

add sort criteria to columns joined to query