[wp-trac] [WordPress Trac] #39350: Twenty Seventeen: Customise location of the Social Links Menu
WordPress Trac
noreply at wordpress.org
Sun Dec 25 08:59:27 UTC 2016
#39350: Twenty Seventeen: Customise location of the Social Links Menu
--------------------------------------+------------------------------
Reporter: pento | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-patch dev-feedback | Focuses:
--------------------------------------+------------------------------
Comment (by sami.keijonen):
I'd like to see this possible without custom widget. It would be nice
feature for themes that want to support it. But I need to take closer look
is that possible without changes in core.
There is a filter `widget_nav_menu_args` which can be a starting point.
{{{
function prefix_widget_social_menu( $nav_menu_args, $nav_menu, $args,
$instance ) {
if ( ! has_nav_menu( 'social' ) ) {
return;
}
$nav_menu_args['theme_location'] = 'social';
$nav_menu_args['link_before'] = '<span class="screen-reader-
text">';
$nav_menu_args['link_after'] = '</span>' .
twentyseventeen_get_svg( array( 'icon' => 'chain' ) );
$nav_menu_args['menu_class'] = 'social-links-menu';
$nav_menu_args['depth'] = 1;
return $nav_menu_args;
}
add_filter( 'widget_nav_menu_args', 'prefix_widget_social_menu', 10, 4 );
}}}
But that messes with all widget nav menus. How can we check that menu
assigned to widget nav menu is the same as assigned to social menu
location?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39350#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list