Merge pull request #7 from Vincent-Design-Inc/bugfix/footer-menu-guard

Refactor footer navigation retrieval logic
This commit is contained in:
Keith Solomon
2026-02-19 14:12:23 -06:00
committed by GitHub

View File

@@ -15,9 +15,10 @@ $copyright_text = getFieldValue( 'footer.copyright_text' ) ? getFieldValue( 'foo
$copyright = str_replace( '%Y', gmdate( 'Y' ), $copyright_text ); $copyright = str_replace( '%Y', gmdate( 'Y' ), $copyright_text );
$locations = get_nav_menu_locations(); $locations = get_nav_menu_locations();
$footerMenu = get_term( $locations['footer_navigation'], 'nav_menu' ); $footerNav = ! empty( $locations['footer_navigation'] )
$footerNav = wp_get_nav_menu_items( $footerMenu->term_id ); ? ( wp_get_nav_menu_items( (int) $locations['footer_navigation'] ) ? wp_get_nav_menu_items( (int) $locations['footer_navigation'] ) : array() )
: array();
?> ?>
</main> </main>