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
- How to modify username before logging in?
- WooCommerce Webhook Action When a New Product Review was Submitted/Created
- Woocommerce – Add a product to cart programmatically via JS or PHP [closed]
- ( Woocommerce) How to get the user belonging to an order? [closed]
- Get the product list of a given Category ID
- List of JS events in the WooCommerce frontend
- get woocommerce My account page link
- WooCommerce: How to edit the get_price_html
- Get woocommerce product price by id [closed]
- Product categories don’t appear as option to build menu
- WooCommerce Variable Product Price not showing on single product page
- How to override WooCommerce template files?
- Woocommerce add extra field to variation product
- Trying to use add_action and do_action with parameters
- Getting the gallery images from products in woocommerce?
- How to get current product category ID in product archive page
- Get url of product’s images (woocommerce)
- WooCommerce prices location in DB
- Order by rating not works in wp_query
- Woocommerce: How to remove page-title at the home/shop page but not category pages
- Woocommerce show cross sells on singe product page [closed]
- How to add a new endpoint in woocommerce
- WordPress Multisite: Adding actions to only one site
- Are there any hook or filter when refund is done through admin -woocommerce
- How to check if is in cart page? [closed]
- Display single product attribute value on Shop page (Woocommerce)
- How to remove action hook done in a plugin from functions.php in my theme?
- WP/WooCommerce REST API cart/checkout/order [closed]
- how to use wc_create_order with subscription product
- WooCommerce: Webhook disabled on its own
- Share users and WooCommerce memberships between two installations
- Slow Loading Attribute Select – WooCommerce Backend
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- How to change or add Woocommerce thank you page URL key content?
- How can I define a custom template for woocommerce [products] shortcode? [closed]
- How to remove an action within a class with extends
- single-product.php template not working for single products [closed]
- Insert variations via woocommerce api [closed]
- WooCommerce get physical store address
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
- how to get woocommerce product attribute slug
- Move payment options at checkout in WooCommerce [closed]
- add_filter to modify woocommerce_cart_item_name hyperlink
- Where do the cart details are stored in database?
- How to display product price of the product in loop
- How to disable Woocommerce password recovery and use the default WordPress password reset page?
- Display order items names in WooCommerce admin orders list [closed]
- Is it safe to delete from db orphaned posts i.e. whose post_parent no longer exists?