namespace HivePress\Blocks;
use HivePress\Helpers as hp;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
class Foo_Bar extends Block {
// Declare the block properties.
public function __construct( $args = [] ) {
// Set the property defaults.
parent::__construct( $args );
public static function init( $meta = [] ) {
// Add label and settings for Gutenberg.
'label' => 'Hello World',
protected function boot() {
// Do something after the block is loaded.
public function render() {
// Render the block HTML content.
if ( $this->say_hello ) {
$output .= 'Hello World!';