strangerstudios / paid-memberships-pro

The Trusted Membership Platform That Grows with You: Restrict access to content and charge recurring subscriptions using Stripe, PayPal, and more. Fully open source. 100% GPL.
https://www.paidmembershipspro.com
Other
468 stars 360 forks source link

custom limit in recent orders REST API #1804

Open nicolaboscolo opened 3 years ago

nicolaboscolo commented 3 years ago

I propose to change the line 775 in includes/rest-api.php to: $limit = apply_filters( 'pmpro_trigger_recent_orders_limit', $params['limit'] ); So the limit GET value could be used. Probably it should be set to 1 if missing in the request. It could be useful when syncing with an accounting system.

mircobabini commented 3 years ago

1) https://github.com/strangerstudios/paid-memberships-pro/blob/b903cd2de65f1871efac1399ec8f143167b062cf/includes/rest-api.php#L724

2) https://github.com/strangerstudios/paid-memberships-pro/blob/b903cd2de65f1871efac1399ec8f143167b062cf/includes/rest-api.php#L775