Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions public_html/wp-content/plugins/camptix/addons/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,33 @@ protected function render_attendees_list( $attr ) {
'paged' => $paged,
'order' => $attr['order'],
'orderby' => $attr['orderby'],
'fields' => 'ids', // ! no post objects
'cache_results' => false,
'fields' => 'ids', // ! no post objects
'cache_results' => false,
'suppress_filters' => false, // Required for posts_orderby filter.
),
$query_args
),
$attr
);
$attendees = get_posts( $attendee_args );

// Use a Unicode 5.2 collation for locale-aware sorting when ordering by title.
$collate_filter = null;
if ( 'title' === $attr['orderby'] ) {
$collate_filter = function ( $orderby ) {
return str_replace(
'.post_title ',
'.post_title COLLATE utf8mb4_unicode_520_ci ',
$orderby
);
};
add_filter( 'posts_orderby', $collate_filter );
}

$attendees = get_posts( $attendee_args );

if ( $collate_filter ) {
remove_filter( 'posts_orderby', $collate_filter );
}

if ( ! is_array( $attendees ) || count( $attendees ) < 1 ) {
break; // life saver!
Expand Down
Loading