thoughtis / cata-blocks

Block Editor components for use with the Cata theme.
GNU General Public License v3.0
1 stars 0 forks source link

Scheduled updates to shopify block have argument type error #111

Closed douglas-johnson closed 12 months ago

douglas-johnson commented 1 year ago

do_scheduled_update is expecting array $options https://github.com/thoughtis/cata-blocks/blob/main/blocks/shopify/includes/feed/update/class-update.php#L30

but when you use wp_schedule_single_event and pass it an array, the array is spread into individual arguments. https://github.com/thoughtis/cata-blocks/blob/main/blocks/shopify/includes/feed/class-feed.php#L79-L83

https://developer.wordpress.org/reference/functions/wp_schedule_single_event/#parameters

I think you could use the spread operator so the arguments become ...$options instead.

Or to use individual arguments, we'd just need to figure out the order.