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 Webhook Action When a New Product Review was Submitted/Created
- how customise Woocommerce style of custom theme
- How to change woocommerce checkout privacy policy, terms and condition text [closed]
- Woocommerce Email show HTML source code [closed]
- add to cart button not adding products in cart only in safari and edge browser [closed]
- WC Lightbox, Zoom and Slider not loading [closed]
- Woocomerce pulling wrong time from server -5 hrs difference
- I want hide view more button if price is blank
- What happens in the database when you link variations in woocommerce? [closed]
- Archive product loop does not work with product filters
- remove sale price after finished countdown in woocommerce
- Woocommerce. How can I charge a fee from seller
- How to update permalink programmatically?
- How to use decimal in quantity fields in WooCommerce for certain categories?
- Getting WordPress fatal error when hitting WooCommerce API
- Adding Tracking Details for Advanced Shipment Tracking Plugin From Order Notes
- Is it ok to 301 redirect product-category pages to custom pages?
- how i can limit woo Category number like as ‘posts_per_page’ => -1, but it cannot work please help me
- Update a list of product to featured if product have meta value (Mysql not wpquery)
- Woocommerce – Add custom email footer to specific email template
- WooCommerce related product – only show from primary category
- Woocommerce: Variable Product – get variation name
- Forgot password flow does not work, getting email with a link but after clicking link it’s not working
- Html code is not showing in woocommerce shop page on adding in header.php?
- Is this code collecting user password?
- WordPress Migration
- some products free and some product is not free for shipping
- Importing Attributes in to Woocommerce
- woocomerce products and categories don’t display fixed
- Save Woocomerce discount as percentage to database
- How to display woocommerce products of one wordpress account in another wordpress account?
- Woocommerce Custom Rewrite Rules Array – Subcategories
- Woocommerce product listing design issues
- How to get an Array from “select” field in advanced custom fields
- change text “free shipping” in WooCommerce [closed]
- Change woocommerce one category image size
- WooCommerce – item added to order not actually saved? [closed]
- show payment receipt in woocommerce thankyou page with custom payment gateway?
- Custom e-commerce display for specific users [closed]
- How to get the attributes based on dependency in woocommerce?
- Woocommerce composite and bundle products
- how to show itemized shipping cost|? [closed]
- GET woocommerce order request is not showing meta data [closed]
- Add a custom meta column to a built-in import CSV file
- Hide/show button for the password field in the Woocommerce My Account page
- Converting longtext to mediumtext in WordPress wp_postmeta table
- How to remove product number count in the category within the sidebar woo commence
- Woocommerce send metadata to stripe
- How to disable the autozoom on mouseover for the product image in Storefront theme of WooCommerce?