PluginProbe
Gutenify – Visual Site Builder Blocks & Starter Templates / 0.0.1
Gutenify – Visual Site Builder Blocks & Starter Templates v0.0.1
1.9.0 1.8.0 1.7.0 1.6.6 1.6.5 1.6.4 trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 74 releases
gutenify / inc / class-blocks-loader.php

class-blocks-loader.php in Gutenify – Visual Site Builder Blocks & Starter Templates 0.0.1, at inc/class-blocks-loader.php

48 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Gutenify block loader file.
4 *
5 * @package Gutenify
6 */
7
8 // Exit if accessed directly.
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class Gutenify_Blocks_Loader{
14 public static function init() {
15 add_action( 'admin_enqueue_scripts', array( __CLASS__, 'add_assets' ) );
16 add_filter( 'block_categories', array( __CLASS__, 'add_block_categories' ) );
17
18 include_once 'blocks/count-down/frontend/style.php';
19 include 'blocks/count-down/block.php';
20 include 'blocks/google-maps/block.php';
21 }
22
23 public static function add_block_categories( $categories ) {
24 $category_slugs = wp_list_pluck( $categories, 'slug' );
25 return in_array( 'gutenify', $category_slugs, true ) ? $categories : array_merge(
26 $categories,
27 array(
28 array(
29 'slug' => 'gutenify',
30 'title' => __( 'Gutenify', 'gutenify' ),
31 'icon' => null,
32 ),
33 )
34 );
35 }
36
37 public static function add_assets() {
38 if( ! Gutenify_Helpers::is_gutenberg_page() ) {
39 return false;
40 }
41 wp_register_style(
42 'gutenify-main-style',
43 plugins_url( 'assets/gutenify_main_css.css', GUTENIFY_PLUGIN_FILE ),
44 array(),
45 time()
46 );
47 }
48 }