Skip to content

Commit

Permalink
PLANET-7382 Move Submenu block into master theme (#1184)
Browse files Browse the repository at this point in the history
- Added check to make sure block is not registered twice
  • Loading branch information
Osong-Michael authored Jan 16, 2024
1 parent f134038 commit 1977a86
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/blocks/class-submenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

namespace P4GBKS\Blocks;

use DOMDocument;
use DOMXPath;
use WP_Block_Type_Registry;

/**
* Class SubMenu
Expand All @@ -26,6 +25,10 @@ class Submenu extends Base_Block {
* Submenu constructor.
*/
public function __construct() {
if ( WP_Block_Type_Registry::get_instance()->is_registered( self::get_full_block_name() ) ) {
return;
}

register_block_type(
self::get_full_block_name(),
[
Expand Down

0 comments on commit 1977a86

Please sign in to comment.