PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.3.9.2
Pods – Custom Content Types and Fields v3.3.9.2
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 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 / classes / PodsComponent.php
pods / classes Last commit date
cli 22 hours ago fields 22 hours ago widgets 22 hours ago Pods.php 22 hours ago PodsAPI.php 22 hours ago PodsAdmin.php 22 hours ago PodsArray.php 22 hours ago PodsComponent.php 22 hours ago PodsComponents.php 22 hours ago PodsData.php 22 hours ago PodsField.php 22 hours ago PodsForm.php 22 hours ago PodsI18n.php 22 hours ago PodsInit.php 22 hours ago PodsMeta.php 22 hours ago PodsMigrate.php 22 hours ago PodsRESTFields.php 22 hours ago PodsRESTHandlers.php 22 hours ago PodsTermSplitting.php 22 hours ago PodsUI.php 22 hours ago PodsView.php 22 hours ago
PodsComponent.php
107 lines
1 <?php
2
3 // Don't load directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 die( '-1' );
6 }
7
8 /**
9 * The base component class, all components should extend this.
10 *
11 * @package Pods
12 */
13 class PodsComponent {
14
15 /**
16 * Setup initial component class.
17 *
18 * @since 2.0.0
19 */
20 public function __construct() {
21
22 $this->init();
23
24 }
25
26 /**
27 * Do things like register/enqueue scripts and stylesheets.
28 *
29 * @since 2.7.2
30 */
31 public function init() {
32
33
34 }
35
36 /**
37 * Add options and set defaults for component settings, shows in admin area
38 *
39 * @return array $options
40 *
41 * @since 2.0.0
42 * public function options () {
43 * $options = array(
44 * 'option_name' => array(
45 * 'label' => 'Option Label',
46 * 'depends-on' => array( 'another_option' => 'specific-value' ),
47 * 'default' => 'default-value',
48 * 'type' => 'field_type',
49 * 'data' => array(
50 * 'value1' => 'Label 1',
51 *
52 * // Group your options together
53 * 'Option Group' => array(
54 * 'gvalue1' => 'Option Label 1',
55 * 'gvalue2' => 'Option Label 2'
56 * ),
57 *
58 * // below is only if the option_name above is the "{$fieldtype}_format_type"
59 * 'value2' => array(
60 * 'label' => 'Label 2',
61 * 'regex' => '[a-zA-Z]' // Uses JS regex validation for the value saved if this option selected
62 * )
63 * ),
64 *
65 * // below is only for a boolean group
66 * 'group' => array(
67 * 'option_boolean1' => array(
68 * 'label' => 'Option boolean 1?',
69 * 'default' => 1,
70 * 'type' => 'boolean'
71 * ),
72 * 'option_boolean2' => array(
73 * 'label' => 'Option boolean 2?',
74 * 'default' => 0,
75 * 'type' => 'boolean'
76 * )
77 * )
78 * )
79 * );
80 *
81 * return $options;
82 * }
83 */
84
85 /**
86 * Handler to run code based on $options
87 *
88 * @param array $options Component options.
89 *
90 * @since 2.0.0
91 */
92 public function handler( $options ) {
93 // run code based on $options set
94 }
95
96 /**
97 * Build admin area
98 *
99 * @param array $options Component options.
100 *
101 * @since 2.0.0
102 * public function admin ( $options ) {
103 * // run code based on $options set
104 * }
105 */
106 }
107