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
- remove_action on after_setup_theme not working from child theme
- Issues with title-tag and document_title_parts
- Remove Actions/Filters added via Anonymous Functions
- Is there any global functions.php file which works for any theme?
- How to influence the information displayed on widget inside wp-admin
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- How to reduce original image quality on upload?
- Add body class of category parent
- Convert hyphen to underscore in permalinks
- Programmatically Add Font-Awesome Icons to Category Widget
- Remove bulk actions based on user role or capabilities
- Override a class function to include a custom template
- How to override filter in child theme?
- How to change a certain text or term of WordPress into a custom into the whole site?
- Child Theme Not Overriding Parent Theme
- Adding body class when post contains a specific shortcode
- Theme-Config tab in admin Pannel?
- Manipulate Output of wp_list_something: select menu instead of li’s
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- Show excerpt for only first post in query
- Is It wrong to use oop approach on functions.php?
- PHP files included in functions.php don’t seem to work
- str_replace function in theme
- Hook specific functions if on a specific admin page
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- functions.php mistakenly deleted
- Echo tags used to describe the theme
- Child Theme files – what is needed?
- How do I add Bootstrap and LESS to my migrated WordPress site?
- How to load jQuery in the footer – nothing works for me
- How to add nav menu items to a specific position within a menu
- Passing values from a widget to a function within a plugin
- Publish/Update post is changing image links from file url to post url
- How to stop twenty fifteen theme from cropping featured images?
- How to remove style attribute in WordPress RSS output?
- Is possible add icon in title posts only in specific tag?
- Is there an alternative to get_template_directory_uri()?
- Add Custom Background Properties to Customizer
- Insert image in WordPress with HTML5 tag and caption function
- How to construct function for applying filter?
- Adding an external HTML link to a post thumbnail
- Replace a menu with widget or a custom template file programmatically
- woocommerce change currency per category [closed]
- Function that outputs second theme url
- Modify post filter to set custom number of posts per page and exclude child posts
- Make wp_link_pages() suitable for Twitter Bootstrap markup
- Setting a default text for excerpts of a particular category
- How to edit the Tags within the image file URLs?
- Add_filter when value is no variable?
- (Woocommerce) Order by price when entering specific category
- unnecessary request call for js and css after calling wp_dequeue_script
- How to edit classes in body tag?
- Possible to hook into Media Library preview File column and use a custom image?
- How to display the_archive_title() and the_archive_description() – “weird” interaction
- 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
- How to override this theme function in child theme
- get_template_directory() – references parent theme directory
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Changing the text of Upload/Insert on Posts and Pages Screen
- Any adverse effects of adding apply_filters to a function?
- Get URLs for AJAX Filter Checkboxes WordPress
- Adding custom social icons to the social media icon block in the Gutenberg editor?
- Header menu aligned right on all pages except for single-post page [closed]
- post value to function with Ajax and jQuery
- How Do I Unhook This Parent Theme Function?
- Allow user only create specific tags
- Child theme remove parent filter in functions
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- Setting Up Child Theme To Take Priority
- 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
- 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?
- Shortcode to eliminate and replace with
- previous_post_link inside of a function?
- Search and Replace Script Loader in Head Only Works in Footer
- Problem in outputting shortcode
- How to Add A Rel Filter to All Links?
- Allow tags and attributes in post and pages content
- Override parent theme function that is not hooked or in the functions.php file
- How does child theme functions.php work with parent theme functions.php? Is it like CSS? [duplicate]
- child_of not working while searching
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- Filter to strip unnecessary attributes
- My website is generating weired url parameters of paginated pages
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- How can I modify or filter this variable in an existing class? (Mai Theme)