PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.9
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.9
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / inc / providers / gutenberg / gutenberg.php
wordpress-popup / inc / providers / gutenberg Last commit date
blocks 3 years ago css 3 years ago js 3 years ago abstract-block.php 3 years ago gutenberg.php 3 years ago
gutenberg.php
117 lines
1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 /**
3 * Hustle_Gutenberg class
4 *
5 * @package Hustle
6 */
7
8 // Load Gutenberg module after Hustle is loaded.
9 add_action( 'init', array( 'Hustle_Gutenberg', 'init' ), 5 );
10 add_filter( 'block_categories_all', array( 'Hustle_Gutenberg', 'register_hustle_category' ), 10, 2 );
11
12 /**
13 * Class Hustle_Gutenberg
14 */
15 class Hustle_Gutenberg {
16
17 /**
18 * Initialize addon
19 *
20 * @since 1.0 Gutenberg Addon
21 */
22 public static function init() {
23 add_action( 'current_screen', array( 'Hustle_Gutenberg', 'gutenberg_init_admin' ) );
24 add_action( 'wp', array( 'Hustle_Gutenberg', 'gutenberg_init_frontend' ) );
25 }
26
27 /**
28 * Automatically include blocks files
29 *
30 * @since 1.0 Gutenberg Addon
31 */
32 public static function load_blocks() {
33 // Load blocks automatically.
34 foreach ( glob( plugin_dir_path( __FILE__ ) . '/blocks/block-*.php' ) as $file ) {
35 require_once $file;
36 }
37 }
38
39 /**
40 * Automatically include blocks files in admin.
41 *
42 * @since 4.2.0
43 */
44 public static function gutenberg_init_admin() {
45 $current_screen = get_current_screen();
46
47 if ( isset( $current_screen->is_block_editor ) && $current_screen->is_block_editor ) {
48 // Load abstracts.
49 require_once dirname( __FILE__ ) . '/abstract-block.php';
50
51 // Load blocks.
52 self::load_blocks();
53 }
54 }
55
56 /**
57 * Automatically include blocks files in frontend.
58 *
59 * @since 4.2.0
60 */
61 public static function gutenberg_init_frontend() {
62 if ( function_exists( 'has_blocks' ) && has_blocks() ) {
63 // Load abstracts.
64 require_once dirname( __FILE__ ) . '/abstract-block.php';
65
66 // Load blocks.
67 self::load_blocks();
68 }
69 }
70
71 /**
72 * Return Addon URL
73 *
74 * @since 1.0 Gutenberg Addon
75 *
76 * @return mixed
77 */
78 public static function get_plugin_url() {
79 return Opt_In::$plugin_url . 'inc/providers/gutenberg';
80 }
81
82 /**
83 * Return Addon DIR
84 *
85 * @since 1.0 Gutenberg Addon
86 *
87 * @return mixed
88 */
89 public static function get_plugin_dir() {
90 return trailingslashit( dirname( __FILE__ ) );
91 }
92
93 /**
94 * Register Hustle's gutenberg category.
95 *
96 * @since 1.0 Gutenberg Addon
97 * @param array $categories Categories.
98 * @param string $block_editor_context Editor context.
99 * @return array
100 */
101 public static function register_hustle_category( $categories, $block_editor_context ) {
102
103 return array_merge(
104 $categories,
105 array(
106 array(
107 'slug' => 'hustle',
108 /* translators: Plugin name */
109 'title' => esc_html( sprintf( __( '%s Blocks', 'hustle' ), Opt_In_Utils::get_plugin_name() ) ),
110 'icon' => '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#000000" d="M56.25 0c7.813 0 15.112 1.465 21.9 4.395 6.787 2.93 12.744 6.958 17.87 12.084 5.127 5.126 9.156 11.083 12.085 17.87 2.93 6.788 4.395 14.087 4.395 21.9 0 7.813-1.465 15.112-4.395 21.9-2.93 6.787-6.958 12.744-12.084 17.87-5.126 5.127-11.083 9.156-17.87 12.085-6.788 2.93-14.087 4.395-21.9 4.395-7.813 0-15.112-1.465-21.9-4.395-6.787-2.93-12.744-6.958-17.87-12.084-5.127-5.126-9.156-11.083-12.085-17.87C1.465 71.36 0 64.062 0 56.25c0-7.813 1.465-15.112 4.395-21.9 2.93-6.787 6.958-12.744 12.084-17.87 5.126-5.127 11.083-9.156 17.87-12.085C41.14 1.465 48.438 0 56.25 0zm38.525 59.473v.146c.098-.587.147-1.197.147-1.832v-1.83c0-.782-.025-1.563-.073-2.345-.05-.78-.123-1.562-.22-2.343-.392-3.614-1.368-7.056-2.93-10.328-1.563-3.27-3.516-6.176-5.86-8.715-2.54-2.832-5.444-5.298-8.716-7.398-3.27-2.1-6.81-3.834-10.62-5.2l-2.05 10.546c1.073.39 3.173 1.465 6.298 3.222 3.125 1.758 5.86 4.102 8.203 7.032 1.66 2.246 2.98 4.712 3.955 7.397.977 2.686 1.465 5.493 1.465 8.423v1.245c0 .44-.05.806-.146 1.1-.197 2.44-1.002 5.223-2.418 8.348-1.416 3.125-3.882 4.688-7.398 4.688h-.293c-.292 0-.61-.072-.95-.22-.343-.145-.66-.316-.953-.512-.196-.293-.342-.61-.44-.952-.097-.342-.146-.708-.146-1.098v-.586l1.612-8.643c.196-1.075.366-2.174.513-3.297.146-1.123.22-2.27.22-3.442 0-3.222-.88-5.76-2.637-7.616-1.758-1.856-4.2-2.784-7.324-2.784-1.465 0-2.906.22-4.322.66-1.416.44-2.71 1.05-3.88 1.83l-1.32.88.293-1.612 5.567-28.125H47.754l-.733 3.955-.73.147c-1.563.293-3.077.732-4.542 1.318-1.465.586-2.88 1.27-4.248 2.05-5.957 3.32-10.79 7.984-14.502 13.99-3.71 6.006-5.566 12.67-5.566 19.995 0 5.37 1.025 10.4 3.076 15.088 2.05 4.688 4.834 8.79 8.35 12.305 3.515 3.517 7.64 6.3 12.377 8.35 4.737 2.05 9.79 3.077 15.16 3.077 2.052 0 4.054-.147 6.007-.44 1.953-.293 3.76-.732 5.42-1.318l1.172-.294-3.955-9.815-.733.148c-1.27.39-2.564.684-3.882.88-1.32.194-2.612.292-3.882.292h-.147c-7.812 0-14.477-2.76-19.995-8.277-5.516-5.517-8.275-12.182-8.275-19.995 0-5.175 1.27-9.936 3.81-14.282 2.538-4.346 5.907-7.74 10.106-10.18l1.026-.586 1.32-.733-7.032 28.125c-.586 2.832-.757 5.225-.513 7.178.245 1.953.904 3.564 1.978 4.834.88 1.172 2.002 2.075 3.37 2.71 1.367.635 2.832.952 4.394.952h1.025l2.49-12.158c.587-3.223 1.758-5.786 3.516-7.69 1.758-1.905 3.418-2.857 4.98-2.857.587 0 1.173.147 1.76.44.585.293.877 1.075.877 2.344 0 .78-.048 1.538-.146 2.27-.098.733-.244 1.392-.44 1.978l-1.757 10.254v.147c-.098 2.343.61 4.443 2.124 6.298 1.514 1.857 3.2 3.175 5.054 3.956.88.39 1.832.684 2.857.88 1.026.195 2.076.292 3.15.292h.147c2.637 0 5.15-.44 7.544-1.318 2.393-.88 4.566-2.05 6.52-3.516 3.222-2.44 5.395-5.42 6.518-8.935 1.123-3.517 1.782-6.35 1.977-8.497z" /></svg>',
111 ),
112 )
113 );
114 }
115
116 }
117