PluginProbe
Pods – Custom Content Types and Fields / 2.8.23.5
Pods – Custom Content Types and Fields v2.8.23.5
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 All 42 releases
pods / src / Pods / Blocks / Collections / Base.php
Base.php
51 lines 783 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Pods\Blocks\Collections;
4
5 /**
6 * Block Collection functionality class.
7 *
8 * @since 2.8.0
9 */
10 abstract class Base {
11
12 /**
13 * Register the block collection with Pods.
14 *
15 * @since 2.8.0
16 */
17 public function register_with_pods() {
18 $collection = $this->block_collection();
19
20 if ( empty( $collection ) ) {
21 return;
22 }
23
24 $collection['name'] = $this->slug();
25
26 pods_register_block_collection( $collection );
27 }
28
29 /**
30 * Get the name/slug of this block collection.
31 *
32 * @since 2.8.0
33 *
34 * @return string
35 */
36 public function slug() {
37 return '';
38 }
39
40 /**
41 * Get block collection configuration to register with Pods.
42 *
43 * @since 2.8.0
44 *
45 * @return array Block collection configuration.
46 */
47 public function block_collection() {
48 return [];
49 }
50 }
51