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
- How do I modify the TinyMCE editor Add Media button to insert a thumbnail preview of PDFs in addition to a text link?
- Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
- How to get WordPress’ hooks/actions run sequence?
- Where can I find a list of WordPress hooks?
- Is there a save_post hook for custom post types?
- Where is the right place to register/enqueue scripts & styles
- How to know what functions are hooked to an action/filter?
- How to hook update_post_meta and delete_post_meta?
- Are there any hooks that alter the 404 logic?
- Is there a hook that runs after a user logs in?
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- TinyMCE: adding CSS to format dropdown
- Difference between do_action and add_action
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- WP Cron Doesn’t Execute When Time Elapses
- WooCommerce: change display order of product short description and price [closed]
- Why do some hooks not work inside class context?
- Difference between after_setup_theme and init action hooks?
- get $post in init filter or action?
- Use wp init hook to call other hooks?
- How many times can I hook into the same action?
- How do I implement the WordPress Iris picker into my plugin on the front-end?
- How to intercept a 404 error
- Move excerpt meta box to above content editor
- Add popup window to TinyMCE buttons
- Action hook for custom tax edit
- Trigger custom action when setting button pressed
- What is “all” in isset($wp_filter[‘all’])
- Whats worth using add_action when we can simply use add_filter?
- Is there a limit to hook priority?
- TinyMCE editor is breaking my beautiful HTML
- Please explain how these hooks work
- Can you add the visual editor to the description field for custom taxonomies?
- WordPress Visual Editor Stripping HTML Changes
- Add_action to wp_head via functions.php
- Hook after image is uploaded and image sizes generated
- How to include own css on wordpress tinymce editor?
- Is there a hook before the user is authenticated?
- Hook that fires when admin setting is saved
- add_action(‘wp_ajax_[action name]’, myfunction) problem
- What is the difference between update_post_meta and update_postmeta hooks?
- Hook on trash post
- Hook *after* user password change?
- Auto-retrieve YouTube Image for Thumbnail?
- Which hook if user profile information is updated?
- How to remove action hook done in a plugin from functions.php in my theme?
- Why does wp_enqueue_style() in plugin not load stylesheet?
- How do i use fontawesome icons in TinyMce editor?
- Hooks for trashing, deleting, saving, restoring custom post type
- Is there a WordPress core & plugins update action hook?
- Remove ‘Custom..’ option in tinyMCE colour swatch
- Hook into WordPress update?
- Any alternate TinyMCE4 themes / subthemes?
- trigger save_post event programmatically
- Implementing advanced add_* function wrappers
- Adding onload to body
- How to replace the content of tinyMCE editor in both text and visual mode using jQuery?
- My add_action (wp_footer, ‘method’) is not calling?
- Do WordPress Core Filenames Work as Hooks?
- What is the earliest possible hook for safely using `is_front_page`?
- switch_to_blog(): Load textdomain
- How to call a REST endpoint when a post is published?
- __NAMESPACE__ with register_activation_hook
- wp_editor disable after reaching character count limit
- Tiny MCE editor stripping xlink:href parameter from SVG USE tag
- Can I hook inside another hook?
- How to add a class to ul tags created by the WordPress editor Tinymce?
- Adding function directly vs using hook in function.php
- Shortcode to insert
- How to edit the actual paragraph dropdown in TinyMCE with custom text styles
- Are hooks called synchronously?
- Is it possible to create nested lists in the WYSIWYG editor?
- How to check if which hook triggered the call to a function?
- How can I send to multiple Contact Form 7 recipients based on form input? [closed]
- Hook into wp_head(); in a plugin
- TinyMCE Anchor Button not showing
- Send data to 3rd party api with wp_remote_post on wp_login
- is it possible to get the hook name in add_action?
- How to keep non-breaking spaces in the visual editor?
- Hook for URL Request
- Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area
- Is there a way to prevent the Editor from modifying my HTML
- How do I flush the rules after saving settings using the Settings API?
- Run javascript code after wp_login hook?
- Does anyone have a visual breakdown of core hooks and when they are fired?
- How to customize the WP admin default help contents
- What is the action hook for save media-form on gallery tab?
- What hook is executed just after wp_query has been executed?
- Remove hidden formatting when user paste text from MS Word into TinyMCE
- Hide gutenberg option blocks
- The ‘user_has_cap’ hook seems to take two page loads to trigger
- How and where can we request new WordPress hooks to be added?
- Disable block from editor based on post type
- WordPress Admin Tooltip hooks