PluginProbe
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs / 2.6.6
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs v2.6.6
5.0.1 4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 All 39 releases
← All changes | inc/layout/registry.php +1 -36 5.0.1 → 2.6.6 View file →
@@ -23,9 +23,9 @@
23 23 * Supported component types.
24 24 *
25 25 * @var array
26 26 */
27 - private static $supported_component_types = [ 'layout', 'section','block','page','header','footer','templates' ];
27 + private static $supported_component_types = [ 'layout', 'section','block','page','header','footer' ];
28 28
29 29 /**
30 30 * Required keys for components.
31 31 *
@@ -76,15 +76,8 @@
76 76 */
77 77 private static $footers = [];
78 78
79 79 /**
80 - * Holds the registered templates.
81 - *
82 - * @var array
83 - */
84 - private static $templates = [];
85 -
86 - /**
87 80 * The Component_Registry object.
88 81 *
89 82 * @var object Component_Registry
90 83 */
@@ -172,16 +165,8 @@
172 165 }
173 166 self::$pages[ $data['key'] ] = $data;
174 167 break;
175 168
176 - case 'templates':
177 - if ( ! empty( self::$templates[ $data['key'] ] ) ) {
178 - /* translators: %s: The component's unique key. */
179 - throw new InvalidArgumentException( sprintf( esc_html__( 'The %s section is already registered.', 'blockspare' ), $data['key'] ) );
180 - }
181 - self::$pages[ $data['key'] ] = $data;
182 - break;
183 -
184 169 default:
185 170 /* translators: %s: This functions name. Will always be Blockspare\Layouts\Component_Registry::add(). */
186 171 throw new InvalidArgumentException( sprintf( esc_html__( 'You must supply a valid component type in %s.', 'blockspare' ), __METHOD__ ) );
187 172 }
@@ -256,16 +241,8 @@
256 241 throw new Exception( sprintf( esc_html__( 'The %s section is not registered.', 'blockspare' ), $key ) );
257 242 }
258 243 unset( self::$footers[ $key ] );
259 244 break;
260 -
261 - case 'templates':
262 - if ( empty( self::$templates[ $key ] ) ) {
263 - /* translators: The requested components unique key. */
264 - throw new Exception( sprintf( esc_html__( 'The %s section is not registered.', 'blockspare' ), $key ) );
265 - }
266 - unset( self::$templates[ $key ] );
267 - break;
268 245 }
269 246
270 247 }
271 248
@@ -329,15 +306,8 @@
329 306 throw new Exception( sprintf( esc_html__( 'The %s section is not registered.', 'blockspare' ), $key ) );
330 307 }
331 308 return self::$footers[ $key ];
332 309
333 - case 'templates':
334 - if ( empty( self::$templates[ $key ] ) ) {
335 - /* translators: The requested components unique key. */
336 - throw new Exception( sprintf( esc_html__( 'The %s section is not registered.', 'blockspare' ), $key ) );
337 - }
338 - return self::$templates[ $key ];
339 -
340 310 default:
341 311 /* translators: This function name. Will always be Blockspare\Layouts\Component_Registry::get(). */
342 312 throw new InvalidArgumentException( sprintf( esc_html__( 'You must supply a valid component type in %s.', 'blockspare' ), __METHOD__ ) );
343 313 }
@@ -395,11 +365,6 @@
395 365 * @return array
396 366 */
397 367 public static function footers() {
398 368 return self::$footers;
399 - }
400 -
401 -
402 - public static function templates() {
403 - return self::$templates;
404 369 }
405 370 }