in filtering one of the meta, you can stop capture depending of the order content
add_filter("get_post_metadata", function ($value, $object_id, $meta_key, $single) {
if ("_stripe_charge_id" === $meta_key) {
$order = wc_get_order($object_id);
if (???) {
// stop capture
$value = FALSE;
}
}
return $value;
}, 10, 4);
Related Posts:
- How to check current user before all actions and filters?
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- Where is the best place to use add_filter
- How to only hook on Single.php after content?
- Use external link in the add sub menu
- Very stubborn wp_register_script / add_action vs remove
- How to prepend to the_title for admin-side plugin’s use
- do_action and hook methods
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Woocommerce Shipping module available only for type of products [closed]
- How to prevent action in ajax request, when in admin side?
- What is the purpose of $merged_filters?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Automatically add attributes to woocommerce product?
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- Get Time Taken By Each Action Hook in WordPress
- Filtering WooCommerce Orders by Category
- Plugin developer automated documentation
- Is there a hook to Intercept al urls from a webpage and redirect to a page
- WordPress user account activation
- External Script Using WP – Hooks / Actions Not Working?
- Redirect to another page using contact form 7? [closed]
- Is there a way to figure out which action/filter invoked a function?
- Using add_action before add_filter on a plugin?
- remove_action not removing add_action from constructor
- Editing wp-config.php
- WooCommerce: after install hook
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- Override a Plugin Function
- How to remove products-links after the product title using remove_action
- How to use add_action for multiple instances of the same class
- How to hook into action/filter call
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Edit post image attributes on fly?
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- WooCommerce Product Table – filter query on attributes
- Disable WC Bookings automatic order completion [closed]
- How to Unhook actions/filters in within Class in plugin
- Nested Actions and Filters
- Use action, filter, or hook to append HTML to WordPress plugin function
- Remove action added in plugin class from theme
- {status}_{post_type} does not run correctly?
- Change hook to add_action in a plugin class
- What action or filter can I use to change all the html returned from server for a page?
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- change output location of plugin function using a custom hook
- Filter for modifying image on upload
- Which filters or actions involve with index page for plugin?
- add query string to all pages after user logged in
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Which action/filter can i use for a Member Plugin [closed]
- How to add product thumbnail on orders list on backend?
- Brands Filter Not Working For On Sale Products
- What characters are allowed as a shortcode tag and how should they be sanitized?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- Determine plugin name from within plugin_action_links filter
- Add multiple attributes to product from php
- How to remove xmlns on language_attributes()?
- add_filter comment_edit_redirect not working
- Only Homepage not loading properly
- woocommerce 3.2.1 not sending order notification emails
- Edit default comments page in WP Admin
- WordPress automatically removes line break
- Add woocommerce variation images in gallery?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- How to disable a plugin for certain page?
- how to do login using woocommerce rest api From android
- Woocommerce Shop page variation product button replace with add to cart button
- Template filter for custom taxonomy terms
- Add action to fire when a published post is updated
- Run a plugin just ‘once’ per page reload
- WooCommerce – set session with new cart item meta when updating cart item quantity [closed]
- Conditional Shipping Options if Certain Products are in Cart WooCommerce
- Woocommerce Backend Search by Title and SKU
- WooCommerce Shopping Cart Not Initially Showing Products [closed]
- Woocommerce singe product custom gallery output works just on the first slide
- Can I filter a function created by a theme or a plugin?
- Add key and value to an array in another file
- Looking for a filter to modify the months
- How to return a specific attribute
- How i remove specific script from header?
- Woocommerce redirection if no previous orders
- How to remove default action from a plugin?
- taxonomy_template filter not working on pagination [duplicate]
- 500 Internal server error wp_handle_upload_prefilter
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- wordpress plugin translation not working
- plugins_loaded action is not working properly
- add_media_page function not creating submenu
- County Finder form/plugin?
- How wordpress plugin hooks works? [duplicate]
- The plugin generated xxx characters of unexpected output during activation
- WP Customer Reviews call short code on another page [closed]
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- How often should I execute add_filter and function declaration in Code Snippets?
- how to add meta for order in woocommerce