Make WordPress Core

Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#37404 closed enhancement (maybelater)

nav-menu cache using javascript

Reported by: tazotodua's profile tazotodua Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Menus Keywords:
Focuses: Cc:

Description

hello.
as we know, caching of navigation menus cause to loose "current-item" classes...
but there could be a solution:
it will be good, if nav-menu could be cached, but WP-CORE should contain something like this, to set "current-item" classes:
http://wordpress.stackexchange.com/a/232574/33667

Change History (5)

#1 @SergeyBiryukov
10 years ago

  • Component changed from General to Menus

#3 @tazotodua
10 years ago

better idea! please, why dont you add this to WP-core?:
attach each link ("<a>" tag) the id of the object. for example:

<li>
  <a class="p284">
</li>

that means POST,with id 284

or

<li>
  <a class="c284">
</li>

that means category,with id 284

and so on... It will be very good!
for this, there exists a filter:

function add_menu_atts( $atts, $item, $args ) {
	$atts['onClick'] = 'return true';    return $atts;
}
add_filter( 'nav_menu_link_attributes', 'add_menu_atts', 10, 3 );
Version 1, edited 10 years ago by tazotodua (previous) (next) (diff)

#4 @tazotodua
8 years ago

  • Resolution set to maybelater
  • Status changed from new to closed

#5 @netweb
8 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.