Unfortunately the filter hook “woocommerce_get_regular_price” is not usable any more. There is another one alternative of that, you can use this below code to achieve your need.
function filter_woocommerce_get_regular_price( $price, $product ) {
// use $product->get_id() to get product ID
// Do any custom logical action
return $price;
}
add_filter( 'woocommerce_product_get_regular_price', 'filter_woocommerce_get_regular_price', 10, 2 );
Related Posts:
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Filter hook before create order WooCommerce
- Display WooCommerce newest product reviews on top [closed]
- How to change Woocommerce breadcrumbs content?
- Add Dropdown menu using “add_filter => wp_nav_menu_items”
- Filter category in WooCommerce shop page to display related sub-category
- How to change currency programmatically on creating order action?
- Redirect to checkout woocommerce failed
- Adaptive product filters for WooCommerce
- Add default user field to WooCommerce checkout [closed]
- Link to Shop-Filter with .current-menu-item
- Adding a Clone link to product attributes – post_row_actions() filter, or how to override a Class question
- Woocommerce “added to cart” message on main(home) page
- Replacing a deprecated filter ‘woocommerce_get_price’ with ‘woocommerce_product_get_price’
- Woocomemrce order and registration fileds to UPPERCASE
- Sorting products by price ( regular + sale price )
- Redirect to woocommerce checkout after adding to cart – item already in cart
- WooCommerce coupon hook argument NULL when using filter woocommerce_get_shop_coupon_data
- How to access page variable inside action hook
- Put data in my-account/view-order/id/ page
- Modify WooCommerce email shipping text value
- WooCommerce comments_template Filter Not Firing
- Woocommerce: Only one review per verified buyer [closed]
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- How would one modify the filtering Gutenberg applies to pasted content?
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- WordPress Internal @ Mentions
- Filter translations (gettext strings) on specific admin pages
- Is it possible to use object in add_action?
- Add Class to Specific Paragraph of the_content()
- apply_filters() slices away needed arguments
- How to override the email function by using filters? [closed]
- Remove WPML’s home_url filter
- How to get current action?
- WordPress codex: apply_filters – clarification on creating a new hook on the fly. How do we use it?
- How to check if “media_send_to_editor” is audio?
- Changing Order of Filters
- how to change appearence of the content of default post list columns?
- Use safety filters even if after applied intval?
- Modify site URL via functions.php of a theme
- Accessing parameters when adding filter
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- Remove Actions added by SEO ultimate Plugin
- Modifying a CoBlocks Filter in Functions
- Shortcodes — Using add_action, add_filter in the shortcode
- Remove Content Filter
- views_edit-post filter not working (custom post type)
- Building a request processor for multi-page forms, etc using $_GET requests
- How to know what filter to use and how to use it?
- Replace audio links with jplayer using the_content filter
- Sorting a specific taxonomy by archive date using URL
- Give “Read More” precedence over excerpt() word count
- Adding a filter to comments_template
- How to customize category_description()?
- Add Bootstrap Classes to Recent Posts Widget
- Add filter to get_posts
- Is it possible to override the default Gallery Settings form?
- Pre filter woocommerce products to remove a certain category of products
- Filtering a list of objects with ‘OR’ on the same field
- Excerpt is being added above the content, but it should be after it
- WordPress add script with custom type (x-jquery-tmpl)
- How to filter bbPress replies (content)?
- Change login CSS
- How to redirect non-logged in users to login with post_password_required()
- Change user nicename without sanitize
- How to override include_once pointed file using add_filter?
- Register new user, assign custom role then send email
- How can I get the default content of WordPress post?
- How do I hide tinymce within the edit screen of a particular page
- What would cause the gettext filter to not work for a given text domain?
- pre_get_posts to hide everywhere posts from “Archive” category
- Strip $before & $after strings from a page title
- How to remove shortcode(s) from WYSIWYG Page editor for Non Admins
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- How do I safely force get_theme_mod() to use a defined get_option(“stylesheet”) value?
- Shortcode / plugin with custom (flexible) output
- Adding a filter to related posts not working
- Two Filter Issue [closed]
- add_action with associative array
- Filter orders in Admin area based on logged in user
- Remove image of srcset
- Add option to query string before get_posts() is called on archive.php
- Modify wp headers on specific page
- Set post featured image to author image
- How to make the show as a button?
- Take filter from multiple functions
- Read More in the actual excerpt
- WP REST API v2. filters doesn’t work
- Is it possible to include the add_filter() function within a shortcode function
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- Is it possible to make get variable out of filter in Class?
- NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]
- Can you call a filter hook by “add_action”?
- Why isn’t this add_filter function working as expected?
- AffiliateWP not calculating multiple quantities when using affwp_calc_referral_amount filter
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- Adding filter to the Contact Form 7 response