function replace_content($text) {
$replace = array(
'Check' => '<span style="color:red">Check</span>',
'Map' => '<span style="color:red">Map</span>',
'Comments' => '<span style="color:red">Comments</span>',
'Print' => '<span style="color:red">Print</span>'
);
$text = str_replace(array_keys($replace), $replace, $text);
return $text;
}
add_filter('the_content','replace_content');
Related Posts:
- The_content and Preg_replace in loaded Iframe [closed]
- Shortcode to eliminate and replace with
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Default or Preset Content for Custom Post Types
- How would go about if I just want a temporary function?
- Adding HTML to the end of every post with the Block Editor
- Insert image in WordPress with HTML5 tag and caption function
- Add Element as a Filter to the_content
- login_headertitle is deprecated since version 5.2.0
- Insert Content Before div#main from the functions.php File
- Problem with images URL after filter applying
- Save_post – Warning: Cannot modify header information
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- $content is empty while using DOMDocument
- How to make an If Else on Excerpt Filter
- child_of not working while searching
- Remove Actions/Filters added via Anonymous Functions
- Display random categories on the front page (Finding and Editing Theme Functions)
- Add class to menu items of one specific menu (nav_menu_css_class)
- How to influence the information displayed on widget inside wp-admin
- Difference between the_content() and get_post()?
- Using add_filter() in Widgets
- Customize WordPress Media Manager – Media Window
- Is it possible to use a forgot password url filter?
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Remove Page Title from Static Frontpage
- Set default options for inserting media
- Remove tag on my RSS Feed
- Override a class function to include a custom template
- Function to wrap the_content in a div
- Delete pages and Create default pages for all new network sites
- Actions according to image type and size
- How to use IF Statement in WordPress?
- Gravity Forms field entries into wp_query loop [closed]
- Post thumbnail relative link and HTML modify
- Post Pagination Showing Same Posts Every Page
- modify a function filter
- Remove the deleted users avatar from list
- How to make applyFilters function return false via functions.php
- How to call custom function from functions.php in site-wide template files?
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- Which action hook to use for function?
- Last updated date function
- Modify a function without editing template
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- How to set default archive image without overriding first attached image? [closed]
- Right way to update widget on dynamic new input field
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- How to make custom column Admin>Users sortable?
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Get Current Post ID in functions php, meta query filter
- Removing “wpautop” (auto tags) only on certain pages?
- Output and filter data from a XML url
- Add to cart php not working [closed]
- create filter in functions.php
- How to filter $content in shortcode function
- How to construct function for applying filter?
- Move Custom Fields on General Settings Page to New Location
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- Redirect to another page using contact form 7? [closed]
- (Woocommerce) Order by price when entering specific category
- Custom HTML markup
- Use a shortcode to display custom meta box contents
- Filter nav menu items HTML tags and wrap inner text with span
- Create custom function for hero image
- Undefined variable error in new function
- How to append classname to body tag if guest user
- How to add custom li item to wordpress menu
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Function to replace comment’s accented characters before posting
- Linking Javascript in functions.php file
- If is_single in functions.php
- Changing the text of Upload/Insert on Posts and Pages Screen
- Conditional custom menu?
- Get URLs for AJAX Filter Checkboxes WordPress
- How to display an image before title text in menu items
- Filter works on last selection but no others
- How to replace ACTION url from original wordpress login form?
- External api call and make global variable for any page visitor enters , page-home, page, single etc
- CSS style and app.js not loading
- Parent category as WOOCommerce Categories widget title
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- How would I correctly implement a new if statement in a child functions file?
- Redirect specific author posts to another url
- True email confirmation for registration (keeping unvalidated users from user table)
- How To Show Shortcodes In WordPress Custom Fields?
- WordPress Add advertising ads befor and after content with periority [closed]
- Best way to add image to recent posts widget?
- Print all inline styles to head
- Get Value of Custom Field
- restrict access to specific urls on a specific period of time
- How to request login for user but not for bots
- Function Reference for custom link in Admin Menu Management Page
- Display a list of users with avatar filterable with alphabets
- How do I add functionality to images?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback