Customize: Remove wp_targeted_link_rel pre-save filter from change-sets.

The pre-save filters added to links in [43732] could invalidate JSON data when saving Customizer change-sets.

This removes the filters when saving and publishing change-sets.

Props peterwilsoncc, nikeo for testing.
See #45292.



git-svn-id: https://develop.svn.wordpress.org/trunk@44714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson
2019-01-29 21:28:57 +00:00
parent ca96ccc55c
commit 99450a446d
4 changed files with 83 additions and 15 deletions
+46
View File
@@ -3095,6 +3095,52 @@ function wp_targeted_link_rel_callback( $matches ) {
return "<a $link_html>";
}
/**
* Adds all filters modifying the rel attribute of targeted links.
*
* @since 5.1.0
*/
function wp_init_targeted_link_rel_filters() {
$filters = array(
'title_save_pre',
'content_save_pre',
'excerpt_save_pre',
'content_filtered_save_pre',
'pre_comment_content',
'pre_term_description',
'pre_link_description',
'pre_link_notes',
'pre_user_description',
);
foreach ( $filters as $filter ) {
add_filter( $filter, 'wp_targeted_link_rel' );
};
}
/**
* Removes all filters modifying the rel attribute of targeted links.
*
* @since 5.1.0
*/
function wp_remove_targeted_link_rel_filters() {
$filters = array(
'title_save_pre',
'content_save_pre',
'excerpt_save_pre',
'content_filtered_save_pre',
'pre_comment_content',
'pre_term_description',
'pre_link_description',
'pre_link_notes',
'pre_user_description',
);
foreach ( $filters as $filter ) {
remove_filter( $filter, 'wp_targeted_link_rel' );
};
}
/**
* Convert one smiley code to the icon graphic file equivalent.
*