将此代码添加到functions.php。根据预订地点的帖子类型进行调整并设置 ASC 或 DESC。
function trojanist_order_booking_locations_by_slug( $query ){
if( $query->get('post_type') == 'booking_location_post_type_slug' ){
$query->set('orderby', 'name');
$query->set('order', 'ASC');
}
}
add_action( 'pre_get_posts', 'trojanist_order_booking_locations_by_slug');