浏览代码

Remove Quadrat PHP Menu Renderer (#4100)

Now that the navigation block has the __unstableLocation attribute the
method of rendering the block is no longer needed and can be removed (as
well as the php header file that was calling it) since it all comes from
blocks now.
Jason Crist 4 年之前
父节点
当前提交
1392fe1de3
共有 2 个文件被更改,包括 0 次插入50 次删除
  1. 0 29
      quadrat/inc/render-navigation-block.php
  2. 0 21
      quadrat/template-parts/header.php

+ 0 - 29
quadrat/inc/render-navigation-block.php

@@ -1,29 +0,0 @@
-<?php
-if ( ! function_exists( 'render_navigation_block' ) ) :
-
-	function render_navigation_block( $menu_location ) {
-		if ( ! has_nav_menu( $menu_location ) ) {
-			return;
-		}
-
-		$block_attributes                 = array();
-		$block_attributes['isResponsive'] = true;
-
-		$nav_items = wp_nav_menu(
-			array(
-				'echo'             => false,
-				'block_attributes' => $block_attributes,
-				'theme_location'   => $menu_location,
-				'container'        => '',
-				'items_wrap'       => '%3$s',
-				'fallback_cb'      => false,
-			)
-		);
-
-		if ( ! $nav_items ) {
-			return;
-		}
-
-		return '<!-- wp:html -->' . $nav_items . '<!-- /wp:html -->';
-	}
-endif;

+ 0 - 21
quadrat/template-parts/header.php

@@ -1,21 +0,0 @@
-<?php
-/**
- * Displays the header.
- * Needed until we have a consistent mechanism to render a navigation between FSE and classic menus.
- *
- * @package Quadrat
- * @since 1.0.0
- *
- */
-
-require get_stylesheet_directory() . '/inc/render-navigation-block.php';
-?>
-
-<?php
-	echo do_blocks(
-		'<!-- wp:group {"tagName":"header","className":"site-header"} -->
-		<header class="wp-block-group site-header"><!-- wp:site-logo /--><!-- wp:site-title /-->' .
-		render_navigation_block( 'primary' ) .
-		'</header><!-- /wp:group -->'
-	);
-?>