mirror of
https://gh.llkk.cc/https://github.com/Tetrakern/fictioneer-minimalist.git
synced 2025-10-03 18:21:00 +08:00
Update menu Transient check
This commit is contained in:
parent
ff16356f18
commit
f9627eae28
2 changed files with 17 additions and 2 deletions
|
@ -516,7 +516,7 @@ if ( $mobile_nav_style === 'collapse' ) {
|
|||
if ( has_nav_menu( 'nav_menu' ) ) {
|
||||
$menu = null;
|
||||
|
||||
if ( FICTIONEER_ENABLE_MENU_TRANSIENTS ) {
|
||||
if ( fictioneer_enable_menu_transients( 'nav_menu' ) ) {
|
||||
$menu = get_transient( 'fictioneer_fcnmm_nav_menu_html' );
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ if ( $mobile_nav_style === 'collapse' ) {
|
|||
$menu = str_replace( ['current_page_item', 'current-menu-item', 'aria-current="page"'], '', $menu );
|
||||
}
|
||||
|
||||
if ( FICTIONEER_ENABLE_MENU_TRANSIENTS ) {
|
||||
if ( fictioneer_enable_menu_transients( 'nav_menu' ) ) {
|
||||
set_transient( 'fictioneer_fcnmm_nav_menu_html', $menu );
|
||||
}
|
||||
}
|
||||
|
|
15
stubs.php
15
stubs.php
|
@ -152,3 +152,18 @@ function fictioneer_sanitize_url( $url, $match = null, $preg_match = null ) {}
|
|||
*/
|
||||
|
||||
function fictioneer_render_icon_menu( $args ) {}
|
||||
|
||||
/**
|
||||
* Whether to enable Transients for menus
|
||||
*
|
||||
* @since 5.25.0
|
||||
*
|
||||
* @param string $location Location identifier of the menu. Possible locations are
|
||||
* 'nav_menu', 'mobile_nav_menu', and 'footer_menu'.
|
||||
*
|
||||
* @return boolean Either true or false.
|
||||
*/
|
||||
|
||||
function fictioneer_enable_menu_transients( $location ) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue