mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user