Ticket #39350: 39350.1.patch
File 39350.1.patch, 3.3 KB (added by , 8 years ago) |
---|
-
src/wp-content/themes/twentyseventeen/inc/icon-functions.php
163 163 add_filter( 'nav_menu_item_title', 'twentyseventeen_dropdown_icon_to_menu_link', 10, 4 ); 164 164 165 165 /** 166 * Display SVG social link icons in custom menu widget. 167 * 168 * @param array $nav_menu_args An array of arguments passed to wp_nav_menu(). 169 * @param WP_Term $nav_menu Nav menu object. 170 * @param array $args Display arguments for the current widget. 171 * @param array $instance Array of settings for the current widget. 172 * @return array $nav_menu_args An array of arguments passed to wp_nav_menu() with social icons. 173 */ 174 function twentyseventeen_widget_social_menu( $nav_menu_args, $nav_menu, $args, $instance ) { 175 if ( ! has_nav_menu( 'social' ) ) { 176 return $nav_menu_args; 177 } 178 179 $menu_location = 'social'; 180 $menu_name = wp_get_nav_menu_object( get_nav_menu_locations( $menu_location )[ $menu_location ] )->name; 181 182 if ( $menu_name === $nav_menu->name ) { 183 $nav_menu_args['theme_location'] = 'social'; 184 $nav_menu_args['link_before'] = '<span class="screen-reader-text">'; 185 $nav_menu_args['link_after'] = '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ); 186 $nav_menu_args['menu_class'] = 'social-links-menu'; 187 $nav_menu_args['depth'] = 1; 188 $nav_menu_args['container_class'] = 'widget-social-navigation'; 189 } 190 191 return $nav_menu_args; 192 } 193 add_filter( 'widget_nav_menu_args', 'twentyseventeen_widget_social_menu', 10, 4 ); 194 195 /** 166 196 * Returns an array of supported social links (URL and icon name). 167 197 * 168 198 * @return array $social_links_icons -
src/wp-content/themes/twentyseventeen/style.css
2305 2305 2306 2306 /* Social nav */ 2307 2307 2308 .social-navigation { 2308 .social-navigation, 2309 .widget-social-navigation { 2309 2310 font-size: 16px; 2310 2311 font-size: 1rem; 2311 2312 margin-bottom: 1em; 2312 2313 } 2313 2314 2314 .social-navigation ul { 2315 .social-navigation ul, 2316 .widget-social-navigation ul { 2315 2317 list-style: none; 2316 2318 margin-bottom: 0; 2317 2319 margin-left: 0; 2318 2320 } 2319 2321 2320 .social-navigation li { 2322 .social-navigation li, 2323 .widget-social-navigation li { 2321 2324 display: inline; 2322 2325 } 2323 2326 2324 .social-navigation a { 2327 .social-navigation a, 2328 .widget-social-navigation a { 2325 2329 background-color: #767676; 2326 2330 -webkit-border-radius: 40px; 2327 2331 border-radius: 40px; … … 2334 2338 } 2335 2339 2336 2340 .social-navigation a:hover, 2337 .social-navigation a:focus { 2341 .social-navigation a:focus, 2342 .widget .widget-social-navigation a:hover, 2343 .widget .widget-social-navigation a:focus { 2338 2344 background-color: #333; 2339 2345 } 2340 2346 2341 .social-navigation .icon { 2347 .widget .widget-social-navigation a:hover, 2348 .widget .widget-social-navigation a:focus { 2349 webkit-box-shadow: none; 2350 box-shadow: none; 2351 color: #fff; 2352 } 2353 2354 .social-navigation .icon, 2355 .widget-social-navigation .icon { 2342 2356 height: 16px; 2343 2357 top: 12px; 2344 2358 width: 16px; … … 2345 2359 vertical-align: top; 2346 2360 } 2347 2361 2362 .widget .widget-social-navigation ul li { 2363 border-bottom: 0; 2364 border-top: 0; 2365 padding: 0; 2366 } 2367 2348 2368 /* Site info */ 2349 2369 2350 2370 .site-info {