# gutenify/0.0.3/inc/class-blocks-loader.php

Gutenify – Visual Site Builder Blocks &amp; Starter Templates, version 0.0.3. 48 lines.

- Page: https://pluginprobe.com/plugins/gutenify/0.0.3/code/inc/class-blocks-loader.php
- Raw: https://pluginprobe.com/plugins/gutenify/0.0.3/raw/inc/class-blocks-loader.php
- Modified: 2020-01-05T17:14:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenify/0.0.3/code/inc/class-blocks-loader.php#L10-L20`.

```php
<?php
/**
 * Gutenify block loader file.
 *
 * @package Gutenify
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Gutenify_Blocks_Loader{
    public static function init() {
        add_action( 'admin_enqueue_scripts', array( __CLASS__, 'add_assets' ) );
        add_filter( 'block_categories', array( __CLASS__, 'add_block_categories' ) );

        include_once 'blocks/count-down/frontend/style.php';
        include 'blocks/count-down/block.php';
        include 'blocks/google-maps/block.php';
    }

    public static function add_block_categories( $categories ) {
        $category_slugs = wp_list_pluck( $categories, 'slug' );
        return in_array( 'gutenify', $category_slugs, true ) ? $categories : array_merge(
            $categories,
            array(
                array(
                    'slug'  => 'gutenify',
                    'title' => __( 'Gutenify', 'gutenify' ),
                    'icon'  => null,
                ),
            )
        );
    }

    public static function add_assets() {
        if( ! Gutenify_Helpers::is_gutenberg_page() ) {
            return false;
        }
        wp_register_style(
            'gutenify-main-style',
            plugins_url( 'assets/gutenify_main_css.css', GUTENIFY_PLUGIN_FILE ),
            array(),
            time()
        );
    }
}
```
