You appear to be a bot. Output may be restricted
Description
Display SVG icons in social links menu.
Usage
$string = twentyseventeen_nav_menu_social_icons( $item_output, $item, $depth, $args );
Parameters
- $item_output
- ( string ) required – The menu item's starting HTML output.
- $item
- ( WP_Post ) required – Menu item data object.
- $depth
- ( int ) required – Depth of the menu. Used for padding.
- $args
- ( stdClass ) required – An object of wp_nav_menu() arguments.
Returns
string The menu item output with social icon.
Source
File name: twentyseventeen/inc/icon-functions.php
Lines:
1 to 15 of 15
function twentyseventeen_nav_menu_social_icons( $item_output, $item, $depth, $args ) { // Get supported social icons. $social_icons = twentyseventeen_social_links_icons(); // Change SVG icon inside social links menu if there is supported URL. if ( 'social' === $args->theme_location ) { foreach ( $social_icons as $attr => $value ) { if ( false !== strpos( $item_output, $attr ) ) { $item_output = str_replace( $args->link_after, '</span>' . twentyseventeen_get_svg( array( 'icon' => esc_attr( $value ) ) ), $item_output ); } } } return $item_output; }