Found the answer. I hope this would be useful to others that might have this problem in the future. All you have to do is remove the content_save_pre
filter and content_filtered_save_pre
this will remove all Kses input form content filters.
//temporarily disable
remove_filter('content_save_pre', 'wp_filter_post_kses');
remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
wp_update_post($post);
//bring it back once you're done posting
add_filter('content_save_pre', 'wp_filter_post_kses');
add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
This works with wp_insert_post
as well.
Related Posts:
- Looking for WordPress System Diagrams
- How can I load a page template from a plugin?
- Overwrite theme file from plugin
- How to control output of custom post type without modifying theme?
- When is it appropriate to put functions on page template vs. functions.php?
- Filter to change the content of 404 page
- How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]
- How to check active theme is parent or child wordpress
- Is there a way to loop through a shortcode datasource to create a table?
- creating custom archive template within plugin for custom post type using archive_template filter
- Where to call wp_enqueue_script in a plugin with custom template?
- Can Page Templates be Applied to Archive and Post Templates?
- ORDER BY wp_post custom column name in wp_query
- Create a free scripts and styles template within a plugin
- How can I turn a custom wordpress page into a product page?
- Plugin templates vs Parent Theme
- How to make “upgrade safe” theme for a plugin?
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- How to create templates for a custom module to show on the front end within my theme?
- Why aren’t some plugin styles loading when I load a template?
- Plugin custom post template; without overriding all posts
- Best way to distribute templates and code accross multiple wordpress sites?
- Load php file with jquery in single.php
- Overriding the template files using a plugin for all themes
- How do I use a plugin to swap out the template file for a custom post type?
- Javascript not being loaded only in custom taxonomy template
- Add new header/footer on landing page with plugin
- Use a page as a template for a custom post type
- Page template compatibility with different themes
- How to set custom homepage via a plugin
- Template file structure , wordpress hook for altering the template
- Displaying External Data – Not Posts
- Making plugin output customizable
- Use different archive template for plugin
- How to display custom taxonomy and terms using/creating plugin template
- How to check during “pre_get_posts” if WP performing default query for specific custom template?
- WP Job Manager – Show recent jobs as cards
- Help interpreting @wordpress/create-block-tutorial-template usage error
- Which hook should be used to add an action containing a redirect?
- the_content after all shortcodes are parsed
- How do I resolve Notice: Undefined offset: 0 in /wp-includes/capabilities.php on line 1145
- Category listing with thumbnail and description on home page
- URLs of plugin resources?
- anything like add_meta_box for categories?
- How to include class from addon after to be sure one class exists in the main plugin?
- Developing a plug-in to charge for
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- What is the Difference between directly call a function and call a function using add_action?
- What is better way to use Bootstrap inside admin panel?
- Updating my plugin without releasing a new version
- Is it possible to check is loaded language files correctly with WordPress plugin?
- Adding JS function as third parameter in do_action
- Plugin Uninstall and Deactivate via Options Menu
- Do I have to override the wp_mail() pluggable function with writing a plugin?
- If a function requires add_action(‘init’) how can I run it only once on plugin activation?
- Ordering posts by metadata
- is_page() function doesnt working
- Order properties should not be accessed directly
- Where to store the name of a custom table?
- Backbone event attachment:compat:ready can’t hook
- Upgrade private plugin without deleting files?
- Register Page Template from Plugin
- Saving value of a selection option in comment form as comment meta
- Is there some way to provide the user a list of existing content in a CPT
- Issue with querying
- Is this best practice for Dynamically adding items to WordPress menus?
- There is a problem in the gutenberg block I developed. Problem is with withInstanceId
- Detect front-end pages only in init hook
- best way to make a WordPresss multisite that is secure but at the same time supporting my plugin development efforts
- How to change title tag at page after loaded post?
- How to get post content by get_posts function?
- Getting following web services error after activating the Rewards Plugin
- WordPress custom taxonomy check box to dropdown
- How to remove plugin-specific custom taxonomy terms when plugin is uninstalled?
- How to modify files inside wp-includes directory in wordpress
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- How to apply style_loader_src filter with exclusion of a specific file?
- Which is the better way to store images for the plugin?
- Minimum Widget Width for Plugin Development
- Should I use wp-content/cache or [PLUGIN_DIR]/cache?
- configuration of .htaccess for add_rewrite_rule to make sense
- Restrict certain actions to plugin-specific admin menu pages only
- Adding tables to dashboard pages programmatically?
- how to add custom fields into new & update post page?
- List all user post API endpoint
- Condition to check previous next article post title
- How to display plugin with javascript using markup of the theme?
- Can display plugin without shortcode?
- Hook for validating and rejecting frontend image upload
- Multisite and the JSON REST API: How to?
- Can’t create a blank template
- Looping single post in a theme
- WP Ajax on page load not working on bluehost but was working on Godaddy
- Is there a way to tell if a shorcode’s handler is being run before or after the content formatting filter?
- How to create an embedded code for wordpress shortcode?
- How can I send an id over the url?
- Creating custom Insert Media page
- Get fields of a widget
- How do you filter get_media_items by mime type in a custom media upload tab?
- Trying to build a plugin – Cannot modify header information