I think your are missing parameters (even if you’re not using those) as per its definition and always try to return
into filters instead of echo
the value. Try the following:
add_filter( 'woocommerce_get_price_html', array( $this, 'get_price_html' ), 10, 2);
public function get_price_html( $price_html, $product )
{
return '<a href="https://wordpress.stackexchange.com/questions/344716/my-price">' . $product->get_price() . '</a>';
}
Related Posts:
- Woocommerce – Hide a Column in Cart Table
- Remove an action by extending class and replacing it
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Override woocommerce loop-start.php from theme using plugin?
- WordPress Reset password Strength set to medium
- Difference Between Filter and Action Hooks?
- How to create an API for my plugin?
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- How can I load a page template from a plugin?
- Using query_vars filter
- How to get Post ID with the Add Filter Function
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- add_filter OO with parameters
- How Can I Add a Filter to Class Instance Only?
- Is it possible to remove next-post / previous-post with out creating a custom template?
- How do I Make a Theme “plugin-ready”?
- How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
- WooCommerce get Shipping Class of product from either the product id or the order after order is completed
- function triggered by “manage_users_custom_column” filter not working
- Proper way to use apply_filters() with class functions?
- How to iterate through custom posts and add the title to an array
- add_filter and remove_filter added before and after wp_query
- How to modify post content before writing to database?
- Actions or filters fired when data is saved in a custom table
- Some nav-menu filters do nothing
- Filter on the_content ignores shortcodes
- Determine which theme location a wp_get_nav_menu_items is for
- How to change wordpress post title?
- Display only certain posts based on visitor’s country?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Conditional add_filter?
- product-attribute-slug-is-too-long-28-characters-max
- Is it possible to create an action hook using do_action() within add_action()?
- get all products of one category
- Hook for post permalink update
- Dynamically Override Fancy Title
- Calling apply_filters on non-documented hooks
- WordPress Media mime type filter problem 4.0
- How to allow Unfiltered HTML in a wordpress multisite install
- Woocommerce add custom button to backend order table
- How to add custom content under plugin row in WordPress admin plugin list?
- Plugin vs Settings load order (woocommerce dependency)
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- Changing bloginfo description from a plugin
- Is there a way to verified if an add_filter is already applied?
- Define a function outside a class and call the function using action or filter hook
- Does add_filter work outside functions.php
- Add multiple shipping rates from add_rate function with custom ID
- set_sale_price in WooCommerce [closed]
- Synchronize Custom post type tags to WordPress default posts tags
- multiple functions with same filter
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- Print value of an array or variable in a payment plugin
- How to get orders with used coupon in WooCommerce
- How to update total price of completed order in woocommerce? [closed]
- Plugin development: get_post_meta is not working [closed]
- $wpdb -> Batch insert from XML File?
- How do I change the initial quantity of a product in woocommerce?
- Order properties should not be accessed directly
- add_filter : Passing an array instead of the callback function?
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- How to check if Woocommerce Order number equals to post ID?
- How do I add custom column to woocommerce cart?
- How plugins_loaded works?
- WordPress after content Hook & external template part
- Namespaced action and filter tags
- Two functions utilizing registration_errors filter
- Is there a Filter that I can use to filter the tags before they are inserted in to the database?
- WordPress is automatically linking plain text email addresses
- best practice for query string values – get_query_var always empty for my value supplied in query string
- get_current_screen() return null
- WooCommerce Conditional Tag inside plugin
- Custom attribute type not displaying terms in edit product – WooCommerce
- WooCommerce registration password field not displaying
- Show special field when correct shipping is chosen
- update woocommere total value on checkout based on selected payment method
- how to add custom functionality after woocommerce place order button
- Problems with: manage_${post_type}_posts_columns
- How To Change Logout Screen Title
- WooCommerce Admin Reports : Get custom product report based on date range
- Add code inside specific wordpress standard function
- Adding a brand column to WooCommerce Products
- Woocommerce checkout update totals with datepicker
- Check for template part, else filter content
- Why doesn’t my simple the_title filter get applied?
- How to filter the_content() & include content from template
- Strange issue saving custom field data for a WooCommerce order
- Adding rewrite rule dynamically
- PHP – Extend WordPress Woocommerce Revenue Analytics with custom field
- Woocommerce – Convert Delivery method into a custom field
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- Replace youtube embed in wordpress
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- Woocommerce extend tax report with custom column
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Show disclaimer with accept button before redirecting to the payment gateway website
- How to check current user before all actions and filters?
- How do I apply a custom discount to individual product total prices depending on their categories on the cart and checkout pages of WooCommerce? [closed]