diff --git a/core/Field/Association_Field.php b/core/Field/Association_Field.php index d46331b3..362ef8d8 100644 --- a/core/Field/Association_Field.php +++ b/core/Field/Association_Field.php @@ -221,7 +221,10 @@ public function get_options( $args = array() ) { $per_page = $this->get_items_per_page(); $offset = ($args['page'] - 1) * $per_page; - $sql_queries .= " ORDER BY `title` ASC LIMIT {$per_page} OFFSET {$offset}"; + $order_by = '`title` ASC'; + $order_by = apply_filters('carbon_fields_association_field_options_order', $order_by, $this->get_base_name(), $args ); + + $sql_queries .= " ORDER BY {$order_by} LIMIT {$per_page} OFFSET {$offset}"; $results = $wpdb->get_results( $sql_queries );