Whenever you see apply_filters( 'filter_name', $value )
, you can use add_filter()
to replace or modify the value of $value
:
add_filter( 'filter_name', 'callback_function' );
Where callback_function
is a function that you create. That function will accept $value
as an argument, and needs to return a new value. So for your example, that will look like this:
function wpse_275788_replace_icon( $icon_html, $id ) {
$icon_html="Put new icon html here.";
return $icon_html;
}
add_filter( 'woocommerce_gateway_icon', 'wpse_275788_replace_icon', 10, 2 );
Related Posts:
- Filter nav menu items HTML tags and wrap inner text with span
- Turn get_posts as string into an array for use in theme admin options
- Possible to hook into Media Library preview File column and use a custom image?
- How can I add a class to a nav li depending on URL?
- Modify gform_other_choice_value for specific form and specific field in Gravity Forms
- Combine embed_oembed_html and oembed_result
- Can’t switch to a child theme using filters template, option_template and option_stylesheet
- login_headertitle is deprecated since version 5.2.0
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- How to display the_archive_title() and the_archive_description() – “weird” interaction
- Filter to wp_list_authors
- How to add custom li item to wordpress menu
- Native gallery custom html output
- The_content and Preg_replace in loaded Iframe [closed]
- Getting the teaser text without overriding global variables
- Default Nav Highlight
- How to edit/replace Parent functions.php function in Child Theme to add “Walker” class
- Functions Filter Question [closed]
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Insert Content Before div#main from the functions.php File
- “options.php” not found
- Add Adsense code between job listings – wp job manager plugin
- Problem with images URL after filter applying
- remove_action not working, even after changing priority [duplicate]
- remove/hide wp-editor
- How to override this theme function in child theme
- get_template_directory() – references parent theme directory
- Replace header image on all other pages but home – URL issue
- Add a class to post if it has been recently updated
- search form leads to 404
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- How do I preserve changes to a theme’s functions.php across updates?
- how to add_filter to non hook function
- Changing the text of Upload/Insert on Posts and Pages Screen
- Any adverse effects of adding apply_filters to a function?
- Conditional custom menu?
- What function actually renders the wp_admin_bar ? How can I call it?
- Get URLs for AJAX Filter Checkboxes WordPress
- Astra theme – cannot set short product description under the product title (product name)
- how can I add filter in specfic field in my website?
- How to display an image before title text in menu items
- Adding custom social icons to the social media icon block in the Gutenberg editor?
- Customizing the wp_video_shortcode output with add_filter
- Filter works on last selection but no others
- Overwrite text in a complicated filter hook
- Header menu aligned right on all pages except for single-post page [closed]
- Override category archive page title (not the head title)
- How to add HTML into error message
- Save_post – Warning: Cannot modify header information
- custom error message for empty username and password using authenticate filter not working
- Class parameter in get_avatar args doesn’t get added to output
- Removing comment lines from all enqueued js files using a filter function
- Add #primary at the end of navlink permalinks on single posts
- post value to function with Ajax and jQuery
- How to add a custom class attribute into code wrapper? [duplicate]
- How Do I Unhook This Parent Theme Function?
- remove_filter function to unhook twentysixteen parent theme function
- CSS style and app.js not loading
- Allow user only create specific tags
- only update titles of single posts
- OOP Switch statement with array as parameter
- Child theme remove parent filter in functions
- How can I automatically delete comments that contain a URL?
- Appending „read more” to the excerpt conditionally
- How to add class dynamically from templates
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- Setting Up Child Theme To Take Priority
- function replace_text for entire page
- add product thumbnail to checkout page only and include variation name
- Redirect specific author posts to another url
- Shortcode Initialization in a Custom Theme
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- ACF Filter return value
- Graphic before title – Specific Category
- Which method is more correct for removing WooCommerce Extensions menu item?
- $content is empty while using DOMDocument
- Hide disclaimer from summary excerpts
- Only seems to be displaying one child when there are supposed to be multiple
- Best way to add image to recent posts widget?
- How to make an If Else on Excerpt Filter
- Why might wptexturize have become re-enabled?
- Shortcode to eliminate and replace with
- previous_post_link inside of a function?
- Search and Replace Script Loader in Head Only Works in Footer
- Regex works in regexr, but not if I filter content [closed]
- Getting back a blank WordPress site following functions code edit
- Retrieve a custom form field modified by a filter
- us states dropdown function and echo in theme template files
- How to pass a variable from a template page to the child theme functions.php
- functions.php filters not applied in AJAX call
- Problem in outputting shortcode
- Settings in functions.php used by a plugin
- Random text changing to weird icons in both admin & front end
- Register a widget area when a theme option has been saved?
- How to Add A Rel Filter to All Links?
- Print all inline styles to head
- Allow tags and attributes in post and pages content