@ shanna
Another thought…
Having slashed quotes on save could indicate that something else is also hooking into the content_save_pre
filter but not properly dealing with slashes.
Connections does have two filters which run when a post is saved in WordPress using the content_save_pre
filter and only one these two manipulates quotes. The clean
function converts smart or fancy quotes to straight quotes but only within the Connections shortcode. That is done because users copy/paste from the website and end up with fancy quotes in the shortcode which WP does not support and can break its shortcode parser. This has saved me a lot of support requests saying shortcode do not work.
When you hook into the content_save_pre
filter you must expect slashed data and then return slashed data.
I decided to checkout the code for Advanced Ads. They do not hook into the content_save_pre
but they do apply that filter to sanitize their ad content before their ad content is saved. This has the effect of causing my clean
function to run on their ad content (not desirable) which does expect slashed data but does not return the data slashed.
I suspect that I am not able to duplicate the issue on my site because their code runs last on my site but on your site Connections code runs last. The run order can be influenced by the order WP loads a plugin when filters have the same priority.
All that said, there is indeed a conflict, but since they are using a core WP filter name in their plugin (and after reviewing their code) I am unable able to see a way for me to remedy the conflict. Ideally they should update their code and its usage of the content_save_pre
filter to expect slashed data and return slashed data to match the WP core usage of the filter.
I do have a work around solution which you can implement.
Install the Code Snippets plugin and add the following code as a new snippet:
add_action( 'plugins_loaded', 'cn_remove_code_pre_filters', 11 );
function cn_remove_code_pre_filters() {
remove_filter( 'content_save_pre', array( 'cnShortcode', 'clean' ) );
remove_filter( 'content_save_pre', array( 'cnShortcode', 'removeCodePreTags' ) );
}
This basically removes the Connections code which is run when a post is saved. They are not critical for function so are safe to remove.
Hope this helps, let me know.