Skip to content

Commit

Permalink
Merge pull request #1106 from gosixl/patch-1
Browse files Browse the repository at this point in the history
Added $claim_id and $hooks as params to action_scheduler_claim_actions_order_by filter
  • Loading branch information
barryhughes authored Oct 2, 2024
2 parents 652735c + 76a5df9 commit 8dce2eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/data-stores/ActionScheduler_DBStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -929,10 +929,13 @@ protected function claim_actions( $claim_id, $limit, \DateTime $before_date = nu
* Sets the order-by clause used in the action claim query.
*
* @since 3.4.0
* @since 3.8.3 Made $claim_id and $hooks available.
*
* @param string $order_by_sql
* @param string $claim_id Claim Id.
* @param array $hooks Hooks to filter for.
*/
$order = apply_filters( 'action_scheduler_claim_actions_order_by', 'ORDER BY priority ASC, attempts ASC, scheduled_date_gmt ASC, action_id ASC' );
$order = apply_filters( 'action_scheduler_claim_actions_order_by', 'ORDER BY priority ASC, attempts ASC, scheduled_date_gmt ASC, action_id ASC', $claim_id, $hooks );
$params[] = $limit;

$sql = $wpdb->prepare( "{$update} {$where} {$order} LIMIT %d", $params ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders
Expand Down

0 comments on commit 8dce2eb

Please sign in to comment.