PHP Class Rarst\Fragment_Cache\Menu_Cache

Inheritance: extends Rarst\Fragment_Cache\Fragment_Cache
Mostra file Open project: rarst/fragment-cache

Public Methods

Method Description
disable ( )
enable ( )
fallback_cb ( array $args ) : string Restore arguments and fetch cached fragment for them.
pre_wp_nav_menu ( string $menu, object $args ) : string Return cached menu, using pre-generation hook.
update_menus_edited ( ) Save timestamp when menus were last modified for cache salt.
wp_nav_menu_args ( array $args ) : array Fake no menu matches to force menu run custom callback.
wp_nav_menu_objects ( array $menu_items ) : array Strip current* classes from menu items, since shared when cached.

Protected Methods

Method Description
callback ( string $name, array $args ) : string Generate and timestamp menu output.

Method Details

callback() protected method

Generate and timestamp menu output.
protected callback ( string $name, array $args ) : string
$name string Fragment name.
$args array Arguments.
return string

disable() public method

public disable ( )

enable() public method

public enable ( )

fallback_cb() public method

Restore arguments and fetch cached fragment for them.
Deprecation:
public fallback_cb ( array $args ) : string
$args array Arguments.
return string

pre_wp_nav_menu() public method

Return cached menu, using pre-generation hook.
public pre_wp_nav_menu ( string $menu, object $args ) : string
$menu string Menu HTML to return.
$args object Menu arguments.
return string

update_menus_edited() public method

Save timestamp when menus were last modified for cache salt.
public update_menus_edited ( )

wp_nav_menu_args() public method

Fake no menu matches to force menu run custom callback.
Deprecation:
public wp_nav_menu_args ( array $args ) : array
$args array Menu arguments.
return array

wp_nav_menu_objects() public method

Strip current* classes from menu items, since shared when cached.
public wp_nav_menu_objects ( array $menu_items ) : array
$menu_items array Array of menu item objects.
return array