WordPress 4.5
[autoinstalls/wordpress.git] / wp-includes / customize / class-wp-customize-nav-menu-item-setting.php
index 073423ecbe72ae37608835399764119530fb0ee9..0bbee67e2fcb937c915d5824cf440f436f98e3ab 100644 (file)
@@ -67,10 +67,11 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
         * Default transport.
         *
         * @since 4.3.0
+        * @since 4.5.0 Default changed to 'refresh'
         * @access public
         * @var string
         */
-       public $transport = 'postMessage';
+       public $transport = 'refresh';
 
        /**
         * The post ID represented by this setting instance. This is the db_id.
@@ -494,7 +495,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
                // @todo We should probably re-apply some constraints imposed by $args.
                unset( $args['include'] );
 
-               // Remove invalid items only in frontend.
+               // Remove invalid items only in front end.
                if ( ! is_admin() ) {
                        $items = array_filter( $items, '_is_valid_nav_menu_item' );
                }
@@ -638,9 +639,9 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
                $menu_item_value['original_title'] = sanitize_text_field( $menu_item_value['original_title'] );
 
                // Apply the same filters as when calling wp_insert_post().
-               $menu_item_value['title'] = apply_filters( 'title_save_pre', $menu_item_value['title'] );
-               $menu_item_value['attr_title'] = apply_filters( 'excerpt_save_pre', $menu_item_value['attr_title'] );
-               $menu_item_value['description'] = apply_filters( 'content_save_pre', $menu_item_value['description'] );
+               $menu_item_value['title'] = wp_unslash( apply_filters( 'title_save_pre', wp_slash( $menu_item_value['title'] ) ) );
+               $menu_item_value['attr_title'] = wp_unslash( apply_filters( 'excerpt_save_pre', wp_slash( $menu_item_value['attr_title'] ) ) );
+               $menu_item_value['description'] = wp_unslash( apply_filters( 'content_save_pre', wp_slash( $menu_item_value['description'] ) ) );
 
                $menu_item_value['url'] = esc_url_raw( $menu_item_value['url'] );
                if ( 'publish' !== $menu_item_value['status'] ) {
@@ -775,7 +776,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
                        $r = wp_update_nav_menu_item(
                                $value['nav_menu_term_id'],
                                $is_placeholder ? 0 : $this->post_id,
-                               $menu_item_data
+                               wp_slash( $menu_item_data )
                        );
 
                        if ( is_wp_error( $r ) ) {