Until this gets fixed, the only workaround I can see is to intercept the $_POST
data and add extra slashes prior to ACF stripping them:
/**
* @link http://wordpress.stackexchange.com/q/143555/1685
*/
function wpse_143555_acf_add_slashes() {
if ( ! empty( $_POST['fields'] ) ) {
foreach ( $_POST['fields'] as $k => $v ) {
if ( ! is_array( $v ) )
$_POST['fields'][ $k ] = addslashes( $v );
}
}
}
add_action( 'save_post', 'wpse_143555_acf_add_slashes', 1 );
Currently it’ll only work on text (string) fields, but I could easily change it to work on others too (not sure of the repercussions though).
Related Posts:
- Unable to check if plugin is active
- Change the path where wordpress plugins are uploaded
- How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
- Using Advanced Custom Fields with WordPress and Lightbox
- Which method is best to enqueue scripts
- How to call plugin path in JS?
- How to store ACF custom fields data in a custom table
- Edit Imported advanced Custom Fields from wordpress Dashboard
- Visual Composer vs. Advanced Custom Fields [closed]
- ACF for audio url in wordpress audio shortcode
- Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint
- Custom field in TWIG template – Advanced custom fields plugin
- Advanced Custom Fields query
- Get uploaded image url
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- How to create Repeater fields using Advanced Custom Fields?
- Loop with array of posts using ‘Advanced Custom Fields’ plugin [closed]
- Using ACF to display data on all pages
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- WP Paths in a Plugin – how to include
- Last modified field for user profile?
- plugins_url function mixes system path and URL
- WP_Query ordering numbers as letters
- Get post by ASC from custome field DATE picker
- Getting value from Advanced Custom Fields [closed]
- Inserting HTML tag with ACF into shortcode
- Advanced Custom Fields plugin – get text from editor field and save it in a variable
- Pull out Advanced Custom Fields in Related post plugin
- Matching Chapters to a Custom posts [closed]
- Advanced Custom Fields displaying on tag pages
- Added slug after URL permalink last slash returns different content
- Custom Fields with Pods not being translated
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- Retrieving a path when dealing with composer packages
- How to remove the inline styles from the content of a WYSIWYG editor field at the time of saving the post?
- add custom filters to the event calendar plugin programatically to frontend [closed]
- Can you use another Profile Builder shortcodes through advanced custom fields
- Using arbitrary paths in page urls
- ACF: post query, hide duplicate values [closed]
- Redirect to another page using contact form 7? [closed]
- Paid Membership Pro with ACF [closed]
- Advanced Custom Fields – Disable Users to Edit Custom Fields
- How to get path or root of plugin folder, not file or dir?
- Using ACF default value to autoincrement a number field
- URLs Added to ACF Repeater Field are not working
- Advanced Custom Fields – Get value in other plugin file [closed]
- Remove Advanced Custom Fields plugin for client?
- Adding class to last list item? Not WP generated
- Keeping and updating ACF and ACF Pro at the same time
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- Correct Plugin File Path
- Hardcoded paths in my plugin
- ACF – How to set the menu order for the relationship field
- Conditional custom redirect
- How to display a number of posts based on a Advanced Custom Field (ACF)
- Translation to ACF relationship field
- How to get the get the select values created by ACF plugin in wordpress
- Absolute paths in backend for plugins after moving wordpress
- Advanced custom fields and Slideshow gallery desn’t work together? [closed]
- Advanced Custom Fields Plugin – Images not displaying
- How to create repeater field manually, without plugin (ACF Pro)?
- How to validate custom fields in Quick edit/bulk edit?
- What snippet do I need to type to show my ACF field show up on my theme?
- Replace the_content with ACF Flexible Content via function
- acf backend error handling
- Setting Author on CPT
- Can’t load the the canges of field groups [duplicate]
- ACF checkbox return format based on page
- ACF Fields are not showing up on Homepage
- Why Custom fields description is not working WordPress Version 5.4.2?
- Include my files in a plugin? [duplicate]
- Images are broken in Wysiwyg Editor – ACF backend
- make p tag collapsed after 3 rows
- Failed GET Request From admin.php To Fetch .min.js File From Unminifed Directory
- How do I change the functionality of an image slider which is part of ACF?
- Change the color of ACF Subtitle output background
- Will downloading a page builder plugin delete my existing data?
- Returning incorrect $post->ID after installing plugin
- ACF Query result in a new td (echo)
- Get a Taxonomy values in an array
- Else If statement for ACF [closed]
- Get not the full path
- Unexpected plugin_dir_path Output
- How to tell if a script is being executed from a plugin, a theme or a child theme in WordPress?
- Advanced Custom Field User Help URL
- Include paths and functions for external scripts
- Hide/Show panel not showing – ACF
- Pulling Advanced Custom Fields from other pages
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- Register additional wp plugin directory
- Custom time field won’t sort regardless of format
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- ACF Taxonomy Object term Null [closed]
- Update acf field in woocommerce orders
- WP-DBManager Plugin Can’t Find Mysql Path
- True/False ACF field returning null by default even if default value is true
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- ACF prugin for WooCommerce Shop Page
- Using ACF to allow user to add and edit multiple saved forms