If you look at the documentation for add_action
, you see that it accepts 4 parameters. The first 2 are required for adding any actions. If you want to change the priority of your action, you use the third parameter. If you want to change the number of arguments the function accepts, you use the fourth parameter.
For your example, the number of arguments is 1, so we use 1 as the fourth parameter. We still need the the third parameter though, so we use the default value of 10.
add_action( 'woocommerce_subscription_payment_complete', 'wpse_106269_payment_complete', 10, 1 );
function wpse_106269_payment_complete( $subscription ) {
//* Use $subscription
}
Related Posts:
- Correct function to get the user’s latest Woocommerce Subscription?
- Limit users to one active subscription in WooCommerce Subscriptions? [closed]
- Adding an action within a function that is being called by add_filter
- Remove action on product archive page [closed]
- How to remove_action inside class [duplicate]
- How do I add a “Cancel” button on the subscriptions listing page [closed]
- WooCommerce Subscriptions: Show monthly Price for annual Product
- Unable to programmatically remove product from WooCommerce cart
- Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?
- What is the action hook for an order that fails on frontend checkout in WooCommerce?
- Remove action added through function
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- How can I add an additional action button into the woocommerce admin order page?
- Edit WooCommerce product content based on category
- How to get woocommerce subscription next payment date or date when subscription expires in woocommerce_subscription_renewal_payment_complete hook?
- Woocommerce Subscription Pricing/Billing Schedule
- WooCommerce subscription, give option to prorate or not to prorate to user while switching subscription
- Subscription on Checkout
- How to subscribe free subscription on user registration in woocommerce subscription plugin?
- How to list all WC products by their attributes values?
- WooCommerce Hook: Content get’s displayed twice and not AFTER the order total
- woocommerce_new_product action doesn’t fire
- How to change a WooCommerce Subscription Deposit and Monthly Payment? [closed]
- password_reset doesnt work
- Woocommerce – Adding row to cart table
- Functions.php change for Woocommerce not working
- Synchronise Renewals on existing subscriptions [closed]
- Display custom product option in admin order details
- WooCommerce Subscriptions: Hide one variation subscription
- wp-cron and woocommerce subscriptions killing performance
- Assign user role by text field in WordPress (Woocommerce) [closed]
- Combine one action and one filter
- How can I send information when a order is completed to my own POS?
- Parameters in woocommerce_before_add_to_cart_button hook
- How to change lost password email text using custom plugin wordpress?
- Overriding Plugin function in your child theme
- Applying pre-production modifications
- Url parameter going to 404 not found
- How to send welcome email once user buys the subscription
- How to apply a custom coupon to a WooCommerce Subscription recurring amount?
- How can I locate where the actions are defined? [duplicate]
- add_action don’t updates theme layout when using values from the WordPress customizer
- Woocommerce add a text field if specific option is selected
- add_filter not works in ajax
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- Edit woocommerce subscription email
- Membership website with discount on scheduled appointment
- How do I remove the recurring total from thank you for your order email?
- Question about WooCommerce Subscription
- Reposition variation stock message
- I want to update shipping charge $0 for all Woocommeerce Subscription auto-renewal orders
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- How to disable Woocommerce password recovery and use the default WordPress password reset page?
- Display WooCommerce size product attribute on shop page
- Redirect if current user is logged out and current page is /my-account
- woocommerce_before_calculate_totals in woocommerce 3.0
- Display a list subcategories under the main product category thumbnails?
- How to Change WooCommerce Variable product pricing by SKU or visible children id
- Is it possible to cache ?wc-ajax=get_variation
- Is WooCommerce updates for WordPress necessary? [closed]
- Display list of categories that contain products with a specific tag
- How to display empty stars on products with woocommerce?
- WooCommerce update_shipping_method ajax call wipes shipping method set on non-checkout page [closed]
- Product options/variations notice displays as an Alert [closed]
- Hide decimal on hompage, category and product page
- Get order_id from the product_id in woocommece [closed]
- Shipping methods in dropdown instead of radio buttons [closed]
- 600k of option_name “c_facebook_background_product_sync_job”
- Adding Buy Button to Blog Post (Woocommerce) [closed]
- Woocommerce get the Archive/Category slug of the current category page
- Woocommerce Variable Product – Please choose product options… [closed]
- woocommerce_order_status_completed not working
- Hide shipping method in woocommerce if custom checkbox field is selected
- how to change add to cart button to call for price button in one of product variation?
- Submitting product attributes via Ninja Forms wordpress?
- Migrating WordPress + WooCommerce from server to Local
- Woocommerce Variation product added twice to cart
- Woocommerce product query not working in other WPML languages
- How to merge 2 accounts with same email address after merge of 2 woocommerce databases
- Get $order in wp_head
- Update WooCommerce stock status with SQL query if stock value is greater than 0
- How to find which last line executed in wordpress?
- Adding order details in woocommerce all booking dashboard
- woocommerce cart related issue cart not deleted
- WooCommerce – Hide price and add to cart button
- How to add a special Woocommerce “Buy Now” button?
- Integration widget Mondial Relay Js
- Custom Registration Fields woocommerce
- Duplicate post/product permalinks. (Link is temporary)
- Woocommerce Shipping based on condition and cart value
- Update order status based on condition
- WooCommerce Table Rates not splitting up
- How can I let the user choose size of a shoe in the store? [closed]
- Hide/show specific products for backend users in woocommerce
- I’d like to add a button under the “Add to Cart” button which says “Buy on Amazon” and links to my Amazon product page [closed]
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- WooCommerce pay per photo upload [closed]
- Woocommerce checkout column total too small can not get it wider [closed]
- Create Custom Coupon Type
- Woocommerce – display all sold out products