public function template_column_orderby($vars)
    {
        if (is_admin() && isset($vars['orderby']) && 'snap_template' === $vars['orderby']) {
            $vars = \array_merge(
                $vars,
                [
                    'orderby' => 'not_exists_clause title',
                    'meta_query' => [
                        'relation' => 'OR',
                        'exists_clause' => [
                            'key' => '_wp_page_template',
                            'compare' => 'EXISTS',
                        ],
                        'not_exists_clause' => [
                            'key' => '_wp_page_template',
                            'compare' => 'NOT EXISTS',
                        ],
                    ],
                ]
            );
        }

        return $vars;
    }
public function template_column_orderby($vars)
    {
        if (is_admin() && isset($vars['orderby']) && 'snap_template' === $vars['orderby']) {
            $vars = \array_merge(
                $vars,
                [
                    'orderby' => 'not_exists_clause title',
                    'meta_query' => [
                        'relation' => 'OR',
                        'exists_clause' => [
                            'key' => '_wp_page_template',
                            'compare' => 'EXISTS',
                        ],
                        'not_exists_clause' => [
                            'key' => '_wp_page_template',
                            'compare' => 'NOT EXISTS',
                        ],
                    ],
                ]
            );
        }

        return $vars;
    }
public function template_column_orderby ( $ vars ) { if ( is_admin ( ) && isset ( $ vars [ 'orderby' ] ) && 'snap_template' === $ vars [ 'orderby' ] ) { $ vars = \ array_merge ( $ vars , [ 'orderby' => 'not_exists_clause title' , 'meta_query' => [ 'relation' => 'OR' , 'exists_clause' => [ 'key' => '_wp_page_template' , 'compare' => 'EXISTS' , ] , 'not_exists_clause' => [ 'key' => '_wp_page_template' , 'compare' => 'NOT EXISTS' , ] , ] , ] ) ; } return $ vars ; }
Define custom orderby rules for custom sortable columns.

@since  1.0.0

@param  array $vars Request query vars before being passed to the global WP_Query, and into pre_get_posts.
@return array
Define custom orderby rules for custom sortable columns .