Here’s a simple function that will replace <em>
with <i>
on your post/page:
function replace_em_with_i($content) {
$content = str_replace('<em>', '<i>', $content);
$content = str_replace('</em>', '</i>', $content);
return $content;
}
add_filter('the_content', 'replace_em_with_i');
Warning: I have tested the code to check if it works (and it does work), but you might want to do some serious testing before using it…
Using a similar function you can replace <strong>
with <b>
, and so on.
I hope this helps…
Related Posts:
- Forcing reload of editor-style.css
- Hook ‘wp_enqueue_scripts’ priority has no effect
- How can I insert HTML attributes with an existing TinyMCE button?
- Using wp_editor tinyMCE in metabox cause form alert on leaving page
- TinyMCE as comment editor – encoding issues
- Show class from css in format dropdown
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- WooCommerce: change display order of product short description and price [closed]
- Is there a WordPress core & plugins update action hook?
- trigger save_post event programmatically
- Shortcode to insert
- is it possible to get the hook name in add_action?
- What hook is executed just after wp_query has been executed?
- Snippet: Use classes instead of inline styles for text alignment
- How to disable TinyMCE 4 keyboard shortcuts
- How to properly test a method that is called by an action hook
- How can I do customizations on login, registration and password recovery forms?
- Custom form action hook
- Is it possible to be more page/post specific with admin_enqueue_script?
- tinyMCE duplicates previous block element when pressing return (visual editor)
- How to send an automated user ‘inactivity’ email?
- Enable Visual Editor In Comments On CPT Edit Page
- How do I successfully create a hook for an email override?
- Added custom styles to Visual Editor. Classes are appended and not replaced as intended
- Disable HTML (Text) Tab in Post Editor
- Cast string to number
- Preserving tabs and line breaks in when switching from HTML to Visual Editor
- How to debug user_register hook
- Storing state between hook functions
- How to have custom tinyMCE buttons break onto next line when too long
- What’s the difference between “wp” and “wp_loaded”?
- WordPress capabilities and restricted categories access
- Preserve shortcode content formatting
- Adding html format on tinymce visual editor
- How to Add Custom CSS to the Media Thickbox?
- How to use custom form on add_meta_boxes callback
- Is it possible to switch Gutenberg’s editor styles when document settings change?
- schedule event in class oriented plugin
- How can I find the hook I need to rewrite a function?
- Show message in media-new.php
- Hooks are not being removed in child theme
- jQuery UI styles conflicting with TinyMCE dialog
- How to i style the elements from the TinyMCE
- add_action second argument missing
- How to get user meta fields that have just been updated?
- admin_notices action doesn’t trigger within save_post action
- Is my code correct to enqueue CSS on a specific page?
- When a plugin gets updated from the repo, does the “activation” hook fire again?
- Defining hooks within (php)classes?
- Divi hook not working [closed]
- Add WordPress hook outside of Plugin or Theme
- How to perform action when plugin/theme editor is used?
- How to run hooks one by one manually?
- What is the proper hook to use for recording a post view?
- How to load this code on function.php
- Stop editor from adding “amp;” after every “&”
- Woocommerce single_product_summary hook not working
- How to style text in WordPress
- Where is publish_post hook fired?
- A good hook to check authorization and redirect?
- Bloginfo hook – can it be more precise?
- enable TinyMCE for comment forms
- Custom posts and get_post_meta in {$post_status}_{$post_type}
- Hooking custom PHP output into WP: how to do it, parse_request almost works but not quite
- Print on screen during shutdown hook – error during saving in theme-editor.php
- How to stop execution of a function via add_action hook?
- changing genesis_before_while in new theme framework
- Moving Javascript from footer to header
- Adding a Media Button to the WordPress Content Editor
- Adding a new hidden field based on a condition in Ninja Forms
- Forcing WooCommerce customers to create account before checking out
- Store user ID on wp_term_taxonomy when new term inserted
- ‘user_register’ hook – need to distinguish if created from wp admin panel
- Make multiple URLs behave as home page
- Customizer Appearance Issue
- Transition_Post_Status hook not working properly
- Wodpress XML Import hooks
- profile_update hook does not fire from front-end
- wp_update_post not getting triggered by hook
- How to get user profile information before update?
- Why is pre_get_posts hook invoked multiple times?
- Undefined fieldId in gform.addFilter for limiting dates in datepicker – Gravity Forms
- Prevent markup being altered when switching between Visual and HTML editors
- Get First Post content and edit it using pre_get_posts (or similar?!)
- Are there Hooks for featured image popup?
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- WordPress sending data with add_action
- How to hide / remove attachment “alt” or “caption” field in Admin?
- Add WordPress Core CSS into editor-style.css
- Why does get_post() not return anything?
- can’t use span or icon tags on when editing visual composer element
- How to force wp excerpt to use br tag?
- Hourly events don’t get triggered
- WordPress save_post hook not firing when checking if _GET[‘post’] is set
- Access post meta just after publishing
- Which hook runs first(init,… or ???) [duplicate]
- Which hook should I use for this scenario regarding the registration process and account/profile update?
- Redirect back to origin page after using get_delete_post_link()
- wp_insert_post() dont post content like i need it :(
- Hooks not working on live server