Changeset 41204 for trunk/src/wp-includes/class-wp-customize-nav-menus.php
- Timestamp:
- 08/02/2017 05:10:05 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r41162 r41204 1266 1266 * @param string $nav_menu_content The HTML content for the navigation menu. 1267 1267 * @param object $args An object containing wp_nav_menu() arguments. 1268 * @return null1268 * @return string Nav menu HTML with selective refresh attributes added if partial can be refreshed. 1269 1269 */ 1270 1270 public function filter_wp_nav_menu( $nav_menu_content, $args ) { … … 1273 1273 $attributes .= ' data-customize-partial-type="nav_menu_instance"'; 1274 1274 $attributes .= sprintf( ' data-customize-partial-placement-context="%s"', esc_attr( wp_json_encode( $args->customize_preview_nav_menus_args ) ) ); 1275 $nav_menu_content = preg_replace( '#^(<\w+)#', '$1 ' . $attributes, $nav_menu_content, 1 );1275 $nav_menu_content = preg_replace( '#^(<\w+)#', '$1 ' . str_replace( '\\', '\\\\', $attributes ), $nav_menu_content, 1 ); 1276 1276 } 1277 1277 return $nav_menu_content;
Note: See TracChangeset
for help on using the changeset viewer.