PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / trunk
Pods – Custom Content Types and Fields vtrunk
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 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / src / Pods / Blocks / Collections / Base.php
pods / src / Pods / Blocks / Collections Last commit date
Base.php 4 months ago Pods.php 4 months ago
Base.php
56 lines
1 <?php
2
3 namespace Pods\Blocks\Collections;
4
5 // Don't load directly.
6 if ( ! defined( 'ABSPATH' ) ) {
7 die( '-1' );
8 }
9
10 /**
11 * Block Collection functionality class.
12 *
13 * @since 2.8.0
14 */
15 abstract class Base {
16
17 /**
18 * Register the block collection with Pods.
19 *
20 * @since 2.8.0
21 */
22 public function register_with_pods() {
23 $collection = $this->block_collection();
24
25 if ( empty( $collection ) ) {
26 return;
27 }
28
29 $collection['name'] = $this->slug();
30
31 pods_register_block_collection( $collection );
32 }
33
34 /**
35 * Get the name/slug of this block collection.
36 *
37 * @since 2.8.0
38 *
39 * @return string
40 */
41 public function slug() {
42 return '';
43 }
44
45 /**
46 * Get block collection configuration to register with Pods.
47 *
48 * @since 2.8.0
49 *
50 * @return array Block collection configuration.
51 */
52 public function block_collection() {
53 return [];
54 }
55 }
56