Version Description
May 11th, 2022 =
Fixed: Attempting to catch potential issues where an issue is detected with loading the Tribe Common library by introducing a wrapper function
pods_container()
to be used before callingtribe()
. (@sc0ttkclark)
Download this release
Release Info
Developer | sc0ttkclark |
Plugin | Pods – Custom Content Types and Fields |
Version | 2.8.17 |
Comparing to | |
See all releases |
Code changes from version 2.8.16 to 2.8.17
- classes/Pods.php +1 -1
- classes/PodsAPI.php +8 -8
- classes/PodsAdmin.php +4 -4
- classes/PodsInit.php +4 -4
- classes/PodsMeta.php +4 -4
- classes/PodsView.php +3 -3
- classes/fields/link.php +1 -1
- classes/fields/pick.php +5 -5
- includes/general.php +41 -7
- init.php +2 -2
- readme.txt +5 -1
- src/Pods/Blocks/API.php +6 -6
- src/Pods/CLI/Commands/Field.php +3 -3
- src/Pods/CLI/Commands/Group.php +3 -3
- src/Pods/CLI/Commands/Pod.php +3 -3
- src/Pods/CLI/Service_Provider.php +3 -3
- src/Pods/REST/V1/Endpoints/Base.php +2 -2
- src/Pods/REST/V1/Endpoints/Swagger_Documentation.php +2 -2
- src/Pods/REST/V1/Post_Repository.php +1 -1
- src/Pods/REST/V1/Service_Provider.php +6 -6
- ui/forms/form.php +1 -1
classes/Pods.php
CHANGED
@@ -866,7 +866,7 @@ class Pods implements Iterator {
|
|
866 |
}
|
867 |
} else {
|
868 |
// Handle custom/supported value mappings.
|
869 |
-
$map_field_values =
|
870 |
|
871 |
$value = $map_field_values->map_value( $first_field, $traverse_fields, $is_field_set ? $field_data : null, $this );
|
872 |
|
866 |
}
|
867 |
} else {
|
868 |
// Handle custom/supported value mappings.
|
869 |
+
$map_field_values = pods_container( Map_Field_Values::class );
|
870 |
|
871 |
$value = $map_field_values->map_value( $first_field, $traverse_fields, $is_field_set ? $field_data : null, $this );
|
872 |
|
classes/PodsAPI.php
CHANGED
@@ -5323,7 +5323,7 @@ class PodsAPI {
|
|
5323 |
pods_no_conflict_on( $pod['type'] );
|
5324 |
}
|
5325 |
|
5326 |
-
$static_cache =
|
5327 |
|
5328 |
// Save relationship / file data
|
5329 |
if ( ! empty( $rel_fields ) ) {
|
@@ -5644,7 +5644,7 @@ class PodsAPI {
|
|
5644 |
* @return array List of changed fields (if $mode = 'get')
|
5645 |
*/
|
5646 |
public static function handle_changed_fields( $pod, $id, $mode = 'set' ) {
|
5647 |
-
$static_cache =
|
5648 |
|
5649 |
$changed_pods_cache = $static_cache->get( 'changed_pods_cache', __CLASS__ ) ?: [];
|
5650 |
$old_fields_cache = $static_cache->get( 'old_fields_cache', __CLASS__ ) ?: [];
|
@@ -5740,7 +5740,7 @@ class PodsAPI {
|
|
5740 |
* @return array List of ID(s) that were setup for saving.
|
5741 |
*/
|
5742 |
public function save_relationships( $id, $related_ids, $pod, $field ) {
|
5743 |
-
$static_cache =
|
5744 |
|
5745 |
$related_data = $static_cache->get( $field['name'] . '/' . $field['id'], 'PodsField_Pick/related_data' ) ?: [];
|
5746 |
|
@@ -5751,7 +5751,7 @@ class PodsAPI {
|
|
5751 |
$current_ids = $this->lookup_related_items( $field['id'], $pod['id'], $id, $field, $pod );
|
5752 |
}
|
5753 |
|
5754 |
-
$static_cache =
|
5755 |
|
5756 |
$cache_key = $pod['id'] . '|' . $field['id'];
|
5757 |
|
@@ -7586,7 +7586,7 @@ class PodsAPI {
|
|
7586 |
}
|
7587 |
}
|
7588 |
|
7589 |
-
$static_cache =
|
7590 |
|
7591 |
$cache_key = $related_pod['id'] . '|' . $related_field['id'];
|
7592 |
|
@@ -9052,7 +9052,7 @@ class PodsAPI {
|
|
9052 |
|
9053 |
$idstring = implode( ',', $params->ids );
|
9054 |
|
9055 |
-
$static_cache =
|
9056 |
|
9057 |
$cache_key = $params->pod_id . '|' . $params->field_id;
|
9058 |
|
@@ -9676,7 +9676,7 @@ class PodsAPI {
|
|
9676 |
|
9677 |
$_info = false;
|
9678 |
|
9679 |
-
$static_cache =
|
9680 |
|
9681 |
$table_info_cache = $static_cache->get( $cache_key, __CLASS__ . '/table_info_cache' ) ?: [];
|
9682 |
|
@@ -10506,7 +10506,7 @@ class PodsAPI {
|
|
10506 |
pods_transient_clear( 'pods_wp_cpt_ct' );
|
10507 |
}
|
10508 |
|
10509 |
-
$static_cache =
|
10510 |
|
10511 |
$static_cache->flush( __CLASS__ );
|
10512 |
$static_cache->flush( __CLASS__ . '/table_info_cache' );
|
5323 |
pods_no_conflict_on( $pod['type'] );
|
5324 |
}
|
5325 |
|
5326 |
+
$static_cache = pods_container( Static_Cache::class );
|
5327 |
|
5328 |
// Save relationship / file data
|
5329 |
if ( ! empty( $rel_fields ) ) {
|
5644 |
* @return array List of changed fields (if $mode = 'get')
|
5645 |
*/
|
5646 |
public static function handle_changed_fields( $pod, $id, $mode = 'set' ) {
|
5647 |
+
$static_cache = pods_container( Static_Cache::class );
|
5648 |
|
5649 |
$changed_pods_cache = $static_cache->get( 'changed_pods_cache', __CLASS__ ) ?: [];
|
5650 |
$old_fields_cache = $static_cache->get( 'old_fields_cache', __CLASS__ ) ?: [];
|
5740 |
* @return array List of ID(s) that were setup for saving.
|
5741 |
*/
|
5742 |
public function save_relationships( $id, $related_ids, $pod, $field ) {
|
5743 |
+
$static_cache = pods_container( Static_Cache::class );
|
5744 |
|
5745 |
$related_data = $static_cache->get( $field['name'] . '/' . $field['id'], 'PodsField_Pick/related_data' ) ?: [];
|
5746 |
|
5751 |
$current_ids = $this->lookup_related_items( $field['id'], $pod['id'], $id, $field, $pod );
|
5752 |
}
|
5753 |
|
5754 |
+
$static_cache = pods_container( Static_Cache::class );
|
5755 |
|
5756 |
$cache_key = $pod['id'] . '|' . $field['id'];
|
5757 |
|
7586 |
}
|
7587 |
}
|
7588 |
|
7589 |
+
$static_cache = pods_container( Static_Cache::class );
|
7590 |
|
7591 |
$cache_key = $related_pod['id'] . '|' . $related_field['id'];
|
7592 |
|
9052 |
|
9053 |
$idstring = implode( ',', $params->ids );
|
9054 |
|
9055 |
+
$static_cache = pods_container( Static_Cache::class );
|
9056 |
|
9057 |
$cache_key = $params->pod_id . '|' . $params->field_id;
|
9058 |
|
9676 |
|
9677 |
$_info = false;
|
9678 |
|
9679 |
+
$static_cache = pods_container( Static_Cache::class );
|
9680 |
|
9681 |
$table_info_cache = $static_cache->get( $cache_key, __CLASS__ . '/table_info_cache' ) ?: [];
|
9682 |
|
10506 |
pods_transient_clear( 'pods_wp_cpt_ct' );
|
10507 |
}
|
10508 |
|
10509 |
+
$static_cache = pods_container( Static_Cache::class );
|
10510 |
|
10511 |
$static_cache->flush( __CLASS__ );
|
10512 |
$static_cache->flush( __CLASS__ . '/table_info_cache' );
|
classes/PodsAdmin.php
CHANGED
@@ -1679,9 +1679,9 @@ class PodsAdmin {
|
|
1679 |
* @return array Global config array.
|
1680 |
*/
|
1681 |
public function get_global_config( $pod = null ) {
|
1682 |
-
$config_pod =
|
1683 |
-
$config_group =
|
1684 |
-
$config_field =
|
1685 |
|
1686 |
// Pod: Backwards compatible configs and hooks.
|
1687 |
$pod_tabs = $config_pod->get_tabs( $pod );
|
@@ -3039,7 +3039,7 @@ class PodsAdmin {
|
|
3039 |
// Turn into a string.
|
3040 |
$auto_start = (string) $auto_start;
|
3041 |
|
3042 |
-
$settings =
|
3043 |
|
3044 |
$fields = $settings->get_setting_fields();
|
3045 |
|
1679 |
* @return array Global config array.
|
1680 |
*/
|
1681 |
public function get_global_config( $pod = null ) {
|
1682 |
+
$config_pod = pods_container( Config_Pod::class );
|
1683 |
+
$config_group = pods_container( Config_Group::class );
|
1684 |
+
$config_field = pods_container( Config_Field::class );
|
1685 |
|
1686 |
// Pod: Backwards compatible configs and hooks.
|
1687 |
$pod_tabs = $config_pod->get_tabs( $pod );
|
3039 |
// Turn into a string.
|
3040 |
$auto_start = (string) $auto_start;
|
3041 |
|
3042 |
+
$settings = pods_container( Settings::class );
|
3043 |
|
3044 |
$fields = $settings->get_setting_fields();
|
3045 |
|
classes/PodsInit.php
CHANGED
@@ -270,18 +270,18 @@ class PodsInit {
|
|
270 |
remove_action( 'plugins_loaded', [ 'Tribe__Admin__Notices', 'instance' ], 1 );
|
271 |
|
272 |
/** @var Tribe__Assets $assets */
|
273 |
-
$assets =
|
274 |
$assets->remove( 'tribe-tooltip' );
|
275 |
|
276 |
/** @var Tribe__Asset__Data $asset_data */
|
277 |
-
$asset_data =
|
278 |
|
279 |
remove_action( 'admin_footer', [ $asset_data, 'render_json' ] );
|
280 |
remove_action( 'customize_controls_print_footer_scripts', [ $asset_data, 'render_json' ] );
|
281 |
remove_action( 'wp_footer', [ $asset_data, 'render_json' ] );
|
282 |
|
283 |
/** @var Tribe__Assets_Pipeline $assets_pipeline */
|
284 |
-
$assets_pipeline =
|
285 |
remove_filter( 'script_loader_tag', [ $assets_pipeline, 'prevent_underscore_conflict' ] );
|
286 |
|
287 |
// Disable the Debug Bar panels.
|
@@ -1217,7 +1217,7 @@ class PodsInit {
|
|
1217 |
$existing_taxonomies = get_taxonomies( [], 'objects' );
|
1218 |
|
1219 |
// Handle static cache for determining whether an object was extended or not.
|
1220 |
-
$static_cache =
|
1221 |
|
1222 |
$existing_post_types_cached = $static_cache->get( 'post_type', __CLASS__ . '/existing_content_types' );
|
1223 |
|
270 |
remove_action( 'plugins_loaded', [ 'Tribe__Admin__Notices', 'instance' ], 1 );
|
271 |
|
272 |
/** @var Tribe__Assets $assets */
|
273 |
+
$assets = pods_container( 'assets' );
|
274 |
$assets->remove( 'tribe-tooltip' );
|
275 |
|
276 |
/** @var Tribe__Asset__Data $asset_data */
|
277 |
+
$asset_data = pods_container( 'asset.data' );
|
278 |
|
279 |
remove_action( 'admin_footer', [ $asset_data, 'render_json' ] );
|
280 |
remove_action( 'customize_controls_print_footer_scripts', [ $asset_data, 'render_json' ] );
|
281 |
remove_action( 'wp_footer', [ $asset_data, 'render_json' ] );
|
282 |
|
283 |
/** @var Tribe__Assets_Pipeline $assets_pipeline */
|
284 |
+
$assets_pipeline = pods_container( 'assets.pipeline' );
|
285 |
remove_filter( 'script_loader_tag', [ $assets_pipeline, 'prevent_underscore_conflict' ] );
|
286 |
|
287 |
// Disable the Debug Bar panels.
|
1217 |
$existing_taxonomies = get_taxonomies( [], 'objects' );
|
1218 |
|
1219 |
// Handle static cache for determining whether an object was extended or not.
|
1220 |
+
$static_cache = pods_container( Static_Cache::class );
|
1221 |
|
1222 |
$existing_post_types_cached = $static_cache->get( 'post_type', __CLASS__ . '/existing_content_types' );
|
1223 |
|
classes/PodsMeta.php
CHANGED
@@ -2827,7 +2827,7 @@ class PodsMeta {
|
|
2827 |
$cached_is_key_covered = pods_cache_get( $type . '/' . $object_name, __CLASS__ . '/is_key_covered' );
|
2828 |
|
2829 |
if ( '404' !== $cached_is_key_covered ) {
|
2830 |
-
$static_cache =
|
2831 |
|
2832 |
// Check if object type/name/key is not covered.
|
2833 |
$cached_is_key_covered = $static_cache->get( $type . '/' . $object_name . '/' . $key, __CLASS__ . '/is_key_covered' );
|
@@ -3733,7 +3733,7 @@ class PodsMeta {
|
|
3733 |
}
|
3734 |
|
3735 |
if ( $meta_key ) {
|
3736 |
-
$static_cache =
|
3737 |
$static_cache->set( $object_type . '/' . $object_name . '/' . $meta_key, '404', __CLASS__ . '/is_key_covered' );
|
3738 |
}
|
3739 |
|
@@ -3932,7 +3932,7 @@ class PodsMeta {
|
|
3932 |
}
|
3933 |
|
3934 |
if ( $meta_key ) {
|
3935 |
-
$static_cache =
|
3936 |
$static_cache->set( $object_type . '/' . $object_name . '/' . $meta_key, '404', __CLASS__ . '/is_key_covered' );
|
3937 |
}
|
3938 |
|
@@ -4047,7 +4047,7 @@ class PodsMeta {
|
|
4047 |
}
|
4048 |
|
4049 |
if ( $meta_key ) {
|
4050 |
-
$static_cache =
|
4051 |
$static_cache->set( $object_type . '/' . $object_name . '/' . $meta_key, '404', __CLASS__ . '/is_key_covered' );
|
4052 |
}
|
4053 |
|
2827 |
$cached_is_key_covered = pods_cache_get( $type . '/' . $object_name, __CLASS__ . '/is_key_covered' );
|
2828 |
|
2829 |
if ( '404' !== $cached_is_key_covered ) {
|
2830 |
+
$static_cache = pods_container( Static_Cache::class );
|
2831 |
|
2832 |
// Check if object type/name/key is not covered.
|
2833 |
$cached_is_key_covered = $static_cache->get( $type . '/' . $object_name . '/' . $key, __CLASS__ . '/is_key_covered' );
|
3733 |
}
|
3734 |
|
3735 |
if ( $meta_key ) {
|
3736 |
+
$static_cache = pods_container( Static_Cache::class );
|
3737 |
$static_cache->set( $object_type . '/' . $object_name . '/' . $meta_key, '404', __CLASS__ . '/is_key_covered' );
|
3738 |
}
|
3739 |
|
3932 |
}
|
3933 |
|
3934 |
if ( $meta_key ) {
|
3935 |
+
$static_cache = pods_container( Static_Cache::class );
|
3936 |
$static_cache->set( $object_type . '/' . $object_name . '/' . $meta_key, '404', __CLASS__ . '/is_key_covered' );
|
3937 |
}
|
3938 |
|
4047 |
}
|
4048 |
|
4049 |
if ( $meta_key ) {
|
4050 |
+
$static_cache = pods_container( Static_Cache::class );
|
4051 |
$static_cache->set( $object_type . '/' . $object_name . '/' . $meta_key, '404', __CLASS__ . '/is_key_covered' );
|
4052 |
}
|
4053 |
|
classes/PodsView.php
CHANGED
@@ -264,7 +264,7 @@ class PodsView {
|
|
264 |
$value = apply_filters( "transient_{$key}", $value );
|
265 |
}
|
266 |
} elseif ( 'static-cache' === $cache_mode && ! in_array( $cache_mode, $nocache ) ) {
|
267 |
-
$static_cache =
|
268 |
|
269 |
$value = $static_cache->get( $key, ( empty( $group ) ? 'pods_view' : $group ) );
|
270 |
} else {
|
@@ -365,7 +365,7 @@ class PodsView {
|
|
365 |
do_action( 'setted_transient', $key );
|
366 |
}
|
367 |
} elseif ( 'static-cache' === $cache_mode ) {
|
368 |
-
$static_cache =
|
369 |
|
370 |
$static_cache->set( $key, $value, ( empty( $group ) ? __CLASS__ : $group ) );
|
371 |
}//end if
|
@@ -474,7 +474,7 @@ class PodsView {
|
|
474 |
do_action( 'deleted_transient', $key );
|
475 |
}
|
476 |
} elseif ( 'static-cache' === $cache_mode ) {
|
477 |
-
$static_cache =
|
478 |
|
479 |
if ( true === $key ) {
|
480 |
$static_cache->flush( ( empty( $group ) ? 'pods_view' : $group ) );
|
264 |
$value = apply_filters( "transient_{$key}", $value );
|
265 |
}
|
266 |
} elseif ( 'static-cache' === $cache_mode && ! in_array( $cache_mode, $nocache ) ) {
|
267 |
+
$static_cache = pods_container( Static_Cache::class );
|
268 |
|
269 |
$value = $static_cache->get( $key, ( empty( $group ) ? 'pods_view' : $group ) );
|
270 |
} else {
|
365 |
do_action( 'setted_transient', $key );
|
366 |
}
|
367 |
} elseif ( 'static-cache' === $cache_mode ) {
|
368 |
+
$static_cache = pods_container( Static_Cache::class );
|
369 |
|
370 |
$static_cache->set( $key, $value, ( empty( $group ) ? __CLASS__ : $group ) );
|
371 |
}//end if
|
474 |
do_action( 'deleted_transient', $key );
|
475 |
}
|
476 |
} elseif ( 'static-cache' === $cache_mode ) {
|
477 |
+
$static_cache = pods_container( Static_Cache::class );
|
478 |
|
479 |
if ( true === $key ) {
|
480 |
$static_cache->flush( ( empty( $group ) ? 'pods_view' : $group ) );
|
classes/fields/link.php
CHANGED
@@ -289,7 +289,7 @@ class PodsField_Link extends PodsField_Website {
|
|
289 |
* Init the editor needed for WP Link modal to work
|
290 |
*/
|
291 |
public function validate_link_modal() {
|
292 |
-
$static_cache =
|
293 |
|
294 |
$init = (boolean) $static_cache->get( 'init', __METHOD__ );
|
295 |
|
289 |
* Init the editor needed for WP Link modal to work
|
290 |
*/
|
291 |
public function validate_link_modal() {
|
292 |
+
$static_cache = pods_container( Static_Cache::class );
|
293 |
|
294 |
$init = (boolean) $static_cache->get( 'init', __METHOD__ );
|
295 |
|
classes/fields/pick.php
CHANGED
@@ -968,7 +968,7 @@ class PodsField_Pick extends PodsField {
|
|
968 |
if ( $this->can_ajax( $args->type, $field_options ) ) {
|
969 |
$ajax = true;
|
970 |
|
971 |
-
$static_cache =
|
972 |
|
973 |
$field_data = $static_cache->get( $field_options['name'] . '/' . $field_options['id'], __CLASS__ . '/field_data' ) ?: [];
|
974 |
|
@@ -1620,7 +1620,7 @@ class PodsField_Pick extends PodsField {
|
|
1620 |
|
1621 |
$options['id'] = (int) $options['id'];
|
1622 |
|
1623 |
-
$static_cache =
|
1624 |
|
1625 |
$related_data = $static_cache->get( $options['name'] . '/' . $options['id'], __CLASS__ . '/related_data' ) ?: [];
|
1626 |
|
@@ -1745,7 +1745,7 @@ class PodsField_Pick extends PodsField {
|
|
1745 |
|
1746 |
$value_ids = array_unique( array_filter( $value ) );
|
1747 |
|
1748 |
-
$static_cache =
|
1749 |
|
1750 |
$related_data = $static_cache->get( $options['name'] . '/' . $options['id'], __CLASS__ . '/related_data' ) ?: [];
|
1751 |
|
@@ -2370,7 +2370,7 @@ class PodsField_Pick extends PodsField {
|
|
2370 |
);
|
2371 |
|
2372 |
if ( 'data' === $context ) {
|
2373 |
-
$static_cache =
|
2374 |
|
2375 |
$static_cache->set( $name . '/' . $options['id'], [
|
2376 |
'autocomplete' => false,
|
@@ -2725,7 +2725,7 @@ class PodsField_Pick extends PodsField {
|
|
2725 |
}//end if
|
2726 |
|
2727 |
if ( 'data' === $context ) {
|
2728 |
-
$static_cache =
|
2729 |
|
2730 |
$static_cache->set( $name . '/' . $options['id'], [
|
2731 |
'autocomplete' => $autocomplete,
|
968 |
if ( $this->can_ajax( $args->type, $field_options ) ) {
|
969 |
$ajax = true;
|
970 |
|
971 |
+
$static_cache = pods_container( Static_Cache::class );
|
972 |
|
973 |
$field_data = $static_cache->get( $field_options['name'] . '/' . $field_options['id'], __CLASS__ . '/field_data' ) ?: [];
|
974 |
|
1620 |
|
1621 |
$options['id'] = (int) $options['id'];
|
1622 |
|
1623 |
+
$static_cache = pods_container( Static_Cache::class );
|
1624 |
|
1625 |
$related_data = $static_cache->get( $options['name'] . '/' . $options['id'], __CLASS__ . '/related_data' ) ?: [];
|
1626 |
|
1745 |
|
1746 |
$value_ids = array_unique( array_filter( $value ) );
|
1747 |
|
1748 |
+
$static_cache = pods_container( Static_Cache::class );
|
1749 |
|
1750 |
$related_data = $static_cache->get( $options['name'] . '/' . $options['id'], __CLASS__ . '/related_data' ) ?: [];
|
1751 |
|
2370 |
);
|
2371 |
|
2372 |
if ( 'data' === $context ) {
|
2373 |
+
$static_cache = pods_container( Static_Cache::class );
|
2374 |
|
2375 |
$static_cache->set( $name . '/' . $options['id'], [
|
2376 |
'autocomplete' => false,
|
2725 |
}//end if
|
2726 |
|
2727 |
if ( 'data' === $context ) {
|
2728 |
+
$static_cache = pods_container( Static_Cache::class );
|
2729 |
|
2730 |
$static_cache->set( $name . '/' . $options['id'], [
|
2731 |
'autocomplete' => $autocomplete,
|
includes/general.php
CHANGED
@@ -1928,7 +1928,7 @@ function pods_redirect( $location, $status = 302, $die = true ) {
|
|
1928 |
* @since 2.0.5
|
1929 |
*/
|
1930 |
function pods_permission( $object ) {
|
1931 |
-
$permissions =
|
1932 |
|
1933 |
return $permissions->user_has_permission( $object );
|
1934 |
}
|
@@ -1943,7 +1943,7 @@ function pods_permission( $object ) {
|
|
1943 |
* @return bool Whether the permissions are restricted for an object.
|
1944 |
*/
|
1945 |
function pods_has_permissions( $object ) {
|
1946 |
-
$permissions =
|
1947 |
|
1948 |
return $permissions->are_permissions_restricted( $object );
|
1949 |
}
|
@@ -3248,7 +3248,20 @@ function pods_reserved_keywords( $context = null ) {
|
|
3248 |
* @return mixed The setting value.
|
3249 |
*/
|
3250 |
function pods_get_setting( $setting_name, $default = null ) {
|
3251 |
-
$settings =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3252 |
|
3253 |
return $settings->get_setting( $setting_name, $default );
|
3254 |
}
|
@@ -3261,7 +3274,7 @@ function pods_get_setting( $setting_name, $default = null ) {
|
|
3261 |
* @return array The setting values.
|
3262 |
*/
|
3263 |
function pods_get_settings() {
|
3264 |
-
$settings =
|
3265 |
|
3266 |
return $settings->get_settings();
|
3267 |
}
|
@@ -3275,7 +3288,7 @@ function pods_get_settings() {
|
|
3275 |
* @param mixed $setting_value The setting value.
|
3276 |
*/
|
3277 |
function pods_update_setting( $setting_name, $setting_value ) {
|
3278 |
-
$settings =
|
3279 |
|
3280 |
$settings->update_setting( $setting_name, $setting_value );
|
3281 |
}
|
@@ -3288,7 +3301,7 @@ function pods_update_setting( $setting_name, $setting_value ) {
|
|
3288 |
* @param array $setting_values The list of settings to update, pass null as a value to remove it.
|
3289 |
*/
|
3290 |
function pods_update_settings( $setting_values ) {
|
3291 |
-
$settings =
|
3292 |
|
3293 |
$settings->update_settings( $setting_values );
|
3294 |
}
|
@@ -3744,7 +3757,7 @@ function pods_svg_icon( $icon_path, $default = 'dashicons-database', $mode = 'ba
|
|
3744 |
$icon_path = PODS_DIR . '/ui/images/icon-menu.svg';
|
3745 |
}
|
3746 |
|
3747 |
-
$static_cache =
|
3748 |
|
3749 |
$icon = $static_cache->get( $icon_path, __FUNCTION__ . '/' . $mode );
|
3750 |
|
@@ -3831,3 +3844,24 @@ function pods_is_types_only( $check_constant_only = false ) {
|
|
3831 |
*/
|
3832 |
return (bool) apply_filters( 'pods_is_types_only', $is_types_only );
|
3833 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1928 |
* @since 2.0.5
|
1929 |
*/
|
1930 |
function pods_permission( $object ) {
|
1931 |
+
$permissions = pods_container( Permissions::class );
|
1932 |
|
1933 |
return $permissions->user_has_permission( $object );
|
1934 |
}
|
1943 |
* @return bool Whether the permissions are restricted for an object.
|
1944 |
*/
|
1945 |
function pods_has_permissions( $object ) {
|
1946 |
+
$permissions = pods_container( Permissions::class );
|
1947 |
|
1948 |
return $permissions->are_permissions_restricted( $object );
|
1949 |
}
|
3248 |
* @return mixed The setting value.
|
3249 |
*/
|
3250 |
function pods_get_setting( $setting_name, $default = null ) {
|
3251 |
+
$settings = pods_container( Settings::class );
|
3252 |
+
|
3253 |
+
// Fallback for the setting handling if it's too early.
|
3254 |
+
if ( ! $settings ) {
|
3255 |
+
$settings = get_option( Settings::OPTION_NAME, [] );
|
3256 |
+
|
3257 |
+
$setting = pods_v( $setting_name, (array) $settings, $default );
|
3258 |
+
|
3259 |
+
if ( null === $setting ) {
|
3260 |
+
return $default;
|
3261 |
+
}
|
3262 |
+
|
3263 |
+
return $setting;
|
3264 |
+
}
|
3265 |
|
3266 |
return $settings->get_setting( $setting_name, $default );
|
3267 |
}
|
3274 |
* @return array The setting values.
|
3275 |
*/
|
3276 |
function pods_get_settings() {
|
3277 |
+
$settings = pods_container( Settings::class );
|
3278 |
|
3279 |
return $settings->get_settings();
|
3280 |
}
|
3288 |
* @param mixed $setting_value The setting value.
|
3289 |
*/
|
3290 |
function pods_update_setting( $setting_name, $setting_value ) {
|
3291 |
+
$settings = pods_container( Settings::class );
|
3292 |
|
3293 |
$settings->update_setting( $setting_name, $setting_value );
|
3294 |
}
|
3301 |
* @param array $setting_values The list of settings to update, pass null as a value to remove it.
|
3302 |
*/
|
3303 |
function pods_update_settings( $setting_values ) {
|
3304 |
+
$settings = pods_container( Settings::class );
|
3305 |
|
3306 |
$settings->update_settings( $setting_values );
|
3307 |
}
|
3757 |
$icon_path = PODS_DIR . '/ui/images/icon-menu.svg';
|
3758 |
}
|
3759 |
|
3760 |
+
$static_cache = pods_container( Static_Cache::class );
|
3761 |
|
3762 |
$icon = $static_cache->get( $icon_path, __FUNCTION__ . '/' . $mode );
|
3763 |
|
3844 |
*/
|
3845 |
return (bool) apply_filters( 'pods_is_types_only', $is_types_only );
|
3846 |
}
|
3847 |
+
|
3848 |
+
/**
|
3849 |
+
* Set up the container and return it.
|
3850 |
+
*
|
3851 |
+
* @since 2.8.17
|
3852 |
+
*
|
3853 |
+
* @param string|null $slug_or_class Either the slug of a binding previously registered using `tribe_singleton` or
|
3854 |
+
* `tribe_register` or the full class name that should be automagically created or
|
3855 |
+
* `null` to get the container instance itself.
|
3856 |
+
*
|
3857 |
+
* @return mixed|null The pods_container() object or null if the function does not exist yet.
|
3858 |
+
*/
|
3859 |
+
function pods_container( $slug_or_class = null ) {
|
3860 |
+
if ( ! function_exists( 'tribe' ) ) {
|
3861 |
+
_doing_it_wrong( __FUNCTION__, 'The function tribe() is not defined yet, there may be a problem loading the Tribe Common library.', '2.8.17' );
|
3862 |
+
|
3863 |
+
return null;
|
3864 |
+
}
|
3865 |
+
|
3866 |
+
return call_user_func_array( 'tribe', func_get_args() );
|
3867 |
+
}
|
init.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* Plugin Name: Pods - Custom Content Types and Fields
|
11 |
* Plugin URI: https://pods.io/
|
12 |
* Description: Pods is a framework for creating, managing, and deploying customized content types and fields
|
13 |
-
* Version: 2.8.
|
14 |
* Author: Pods Framework Team
|
15 |
* Author URI: https://pods.io/about/
|
16 |
* Text Domain: pods
|
@@ -43,7 +43,7 @@ if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) {
|
|
43 |
add_action( 'init', 'pods_deactivate_pods_ui' );
|
44 |
} else {
|
45 |
// Current version.
|
46 |
-
define( 'PODS_VERSION', '2.8.
|
47 |
|
48 |
// Current database version, this is the last version the database changed.
|
49 |
define( 'PODS_DB_VERSION', '2.3.5' );
|
10 |
* Plugin Name: Pods - Custom Content Types and Fields
|
11 |
* Plugin URI: https://pods.io/
|
12 |
* Description: Pods is a framework for creating, managing, and deploying customized content types and fields
|
13 |
+
* Version: 2.8.17
|
14 |
* Author: Pods Framework Team
|
15 |
* Author URI: https://pods.io/about/
|
16 |
* Text Domain: pods
|
43 |
add_action( 'init', 'pods_deactivate_pods_ui' );
|
44 |
} else {
|
45 |
// Current version.
|
46 |
+
define( 'PODS_VERSION', '2.8.17' );
|
47 |
|
48 |
// Current database version, this is the last version the database changed.
|
49 |
define( 'PODS_DB_VERSION', '2.3.5' );
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: pods, custom post types, custom taxonomies, content types, custom fields,
|
|
5 |
Requires at least: 5.5
|
6 |
Tested up to: 6.0
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 2.8.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -156,6 +156,10 @@ Pods really wouldn't be where it is without all the contributions from our [dono
|
|
156 |
|
157 |
== Changelog ==
|
158 |
|
|
|
|
|
|
|
|
|
159 |
= 2.8.16 - May 6th, 2022 =
|
160 |
|
161 |
* Added: More compatiblity with Advanced Relationship Storage Add-On from Pods Pro by SKCDEV which allows for saving table-based relationship fields during the normal save process. (@sc0ttkclark)
|
5 |
Requires at least: 5.5
|
6 |
Tested up to: 6.0
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 2.8.17
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
156 |
|
157 |
== Changelog ==
|
158 |
|
159 |
+
= 2.8.17 - May 11th, 2022 =
|
160 |
+
|
161 |
+
* Fixed: Attempting to catch potential issues where an issue is detected with loading the Tribe Common library by introducing a wrapper function `pods_container()` to be used before calling `tribe()`. (@sc0ttkclark)
|
162 |
+
|
163 |
= 2.8.16 - May 6th, 2022 =
|
164 |
|
165 |
* Added: More compatiblity with Advanced Relationship Storage Add-On from Pods Pro by SKCDEV which allows for saving table-based relationship fields during the normal save process. (@sc0ttkclark)
|
src/Pods/Blocks/API.php
CHANGED
@@ -78,12 +78,12 @@ class API {
|
|
78 |
*/
|
79 |
do_action( 'pods_blocks_api_pre_init' );
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
|
88 |
/**
|
89 |
* Allow custom blocks to be registered with Pods.
|
78 |
*/
|
79 |
do_action( 'pods_blocks_api_pre_init' );
|
80 |
|
81 |
+
pods_container( 'pods.blocks.collection.pods' );
|
82 |
+
pods_container( 'pods.blocks.field' );
|
83 |
+
pods_container( 'pods.blocks.form' );
|
84 |
+
pods_container( 'pods.blocks.list' );
|
85 |
+
pods_container( 'pods.blocks.single' );
|
86 |
+
pods_container( 'pods.blocks.view' );
|
87 |
|
88 |
/**
|
89 |
* Allow custom blocks to be registered with Pods.
|
src/Pods/CLI/Commands/Field.php
CHANGED
@@ -20,8 +20,8 @@ class Field extends Base {
|
|
20 |
* @since 2.8.0
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
-
$this->endpoint_archive =
|
24 |
-
$this->endpoint_single =
|
25 |
-
$this->endpoint_single_slug =
|
26 |
}
|
27 |
}
|
20 |
* @since 2.8.0
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
+
$this->endpoint_archive = pods_container( 'pods.rest-v1.endpoints.fields' );
|
24 |
+
$this->endpoint_single = pods_container( 'pods.rest-v1.endpoints.field' );
|
25 |
+
$this->endpoint_single_slug = pods_container( 'pods.rest-v1.endpoints.field-slug' );
|
26 |
}
|
27 |
}
|
src/Pods/CLI/Commands/Group.php
CHANGED
@@ -20,8 +20,8 @@ class Group extends Base {
|
|
20 |
* @since 2.8.0
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
-
$this->endpoint_archive =
|
24 |
-
$this->endpoint_single =
|
25 |
-
$this->endpoint_single_slug =
|
26 |
}
|
27 |
}
|
20 |
* @since 2.8.0
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
+
$this->endpoint_archive = pods_container( 'pods.rest-v1.endpoints.groups' );
|
24 |
+
$this->endpoint_single = pods_container( 'pods.rest-v1.endpoints.group' );
|
25 |
+
$this->endpoint_single_slug = pods_container( 'pods.rest-v1.endpoints.group-slug' );
|
26 |
}
|
27 |
}
|
src/Pods/CLI/Commands/Pod.php
CHANGED
@@ -20,8 +20,8 @@ class Pod extends Base {
|
|
20 |
* @since 2.8.0
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
-
$this->endpoint_archive =
|
24 |
-
$this->endpoint_single =
|
25 |
-
$this->endpoint_single_slug =
|
26 |
}
|
27 |
}
|
20 |
* @since 2.8.0
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
+
$this->endpoint_archive = pods_container( 'pods.rest-v1.endpoints.pods' );
|
24 |
+
$this->endpoint_single = pods_container( 'pods.rest-v1.endpoints.pod' );
|
25 |
+
$this->endpoint_single_slug = pods_container( 'pods.rest-v1.endpoints.pod-slug' );
|
26 |
}
|
27 |
}
|
src/Pods/CLI/Service_Provider.php
CHANGED
@@ -42,9 +42,9 @@ class Service_Provider extends \tad_DI52_ServiceProvider {
|
|
42 |
*/
|
43 |
protected function hooks() {
|
44 |
// Add dynamic commands.
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
|
49 |
// Add static commands.
|
50 |
if ( defined( 'WP_CLI' ) ) {
|
42 |
*/
|
43 |
protected function hooks() {
|
44 |
// Add dynamic commands.
|
45 |
+
pods_container( 'pods.cli.commands.pods.pod' );
|
46 |
+
pods_container( 'pods.cli.commands.pods.group' );
|
47 |
+
pods_container( 'pods.cli.commands.pods.field' );
|
48 |
|
49 |
// Add static commands.
|
50 |
if ( defined( 'WP_CLI' ) ) {
|
src/Pods/REST/V1/Endpoints/Base.php
CHANGED
@@ -211,7 +211,7 @@ abstract class Base {
|
|
211 |
*/
|
212 |
public function get_route() {
|
213 |
/** @var Main $main */
|
214 |
-
$main =
|
215 |
|
216 |
$namespace = $main->get_pods_route_namespace();
|
217 |
|
@@ -791,7 +791,7 @@ abstract class Base {
|
|
791 |
}
|
792 |
|
793 |
try {
|
794 |
-
$doc_endpoint_obj =
|
795 |
|
796 |
$doc_endpoint_obj->register_documentation_provider( $rest_doc_route, $this );
|
797 |
} catch ( Exception $exception ) {
|
211 |
*/
|
212 |
public function get_route() {
|
213 |
/** @var Main $main */
|
214 |
+
$main = pods_container( 'pods.rest-v1.main' );
|
215 |
|
216 |
$namespace = $main->get_pods_route_namespace();
|
217 |
|
791 |
}
|
792 |
|
793 |
try {
|
794 |
+
$doc_endpoint_obj = pods_container( 'pods.rest-v1.endpoints.documentation' );
|
795 |
|
796 |
$doc_endpoint_obj->register_documentation_provider( $rest_doc_route, $this );
|
797 |
} catch ( Exception $exception ) {
|
src/Pods/REST/V1/Endpoints/Swagger_Documentation.php
CHANGED
@@ -38,7 +38,7 @@ class Swagger_Documentation implements Provider_Interface, READ_Endpoint_Interfa
|
|
38 |
|
39 |
public function hook() {
|
40 |
/** @var Main $main */
|
41 |
-
$main =
|
42 |
|
43 |
$this->set_current_rest_api_version( $main->get_semantic_version() );
|
44 |
}
|
@@ -80,7 +80,7 @@ class Swagger_Documentation implements Provider_Interface, READ_Endpoint_Interfa
|
|
80 |
*/
|
81 |
public function get_documentation() {
|
82 |
/** @var Main $main */
|
83 |
-
$main =
|
84 |
|
85 |
$documentation = [
|
86 |
'openapi' => $this->open_api_version,
|
38 |
|
39 |
public function hook() {
|
40 |
/** @var Main $main */
|
41 |
+
$main = pods_container( 'pods.rest-v1.main' );
|
42 |
|
43 |
$this->set_current_rest_api_version( $main->get_semantic_version() );
|
44 |
}
|
80 |
*/
|
81 |
public function get_documentation() {
|
82 |
/** @var Main $main */
|
83 |
+
$main = pods_container( 'pods.rest-v1.main' );
|
84 |
|
85 |
$documentation = [
|
86 |
'openapi' => $this->open_api_version,
|
src/Pods/REST/V1/Post_Repository.php
CHANGED
@@ -39,7 +39,7 @@ class Post_Repository extends REST_Post_Repository {
|
|
39 |
'_pods_field' => [ $this, 'get_field_data' ],
|
40 |
];
|
41 |
|
42 |
-
$this->messages = $messages ? $messages :
|
43 |
}
|
44 |
|
45 |
/**
|
39 |
'_pods_field' => [ $this, 'get_field_data' ],
|
40 |
];
|
41 |
|
42 |
+
$this->messages = $messages ? $messages : pods_container( 'pods.rest-v1.messages' );
|
43 |
}
|
44 |
|
45 |
/**
|
src/Pods/REST/V1/Service_Provider.php
CHANGED
@@ -42,9 +42,9 @@ class Service_Provider extends \tad_DI52_ServiceProvider {
|
|
42 |
$this->container->singleton( 'pods.rest-v1.validator', Base_Validator::class );
|
43 |
$this->container->singleton( 'pods.rest-v1.repository', Post_Repository::class );
|
44 |
|
45 |
-
$messages =
|
46 |
-
$post_repository =
|
47 |
-
$validator =
|
48 |
|
49 |
$endpoints = $this->get_endpoints();
|
50 |
|
@@ -96,7 +96,7 @@ class Service_Provider extends \tad_DI52_ServiceProvider {
|
|
96 |
*/
|
97 |
public function register_endpoints() {
|
98 |
/** @var Main $main */
|
99 |
-
$main =
|
100 |
|
101 |
$this->namespace = $main->get_pods_route_namespace();
|
102 |
|
@@ -108,7 +108,7 @@ class Service_Provider extends \tad_DI52_ServiceProvider {
|
|
108 |
}
|
109 |
|
110 |
try {
|
111 |
-
$endpoint_obj =
|
112 |
|
113 |
if ( method_exists( $endpoint_obj, 'register_routes' ) ) {
|
114 |
$endpoint_obj->register_routes( $this->namespace, true );
|
@@ -130,7 +130,7 @@ class Service_Provider extends \tad_DI52_ServiceProvider {
|
|
130 |
*/
|
131 |
protected function register_endpoint_documentation() {
|
132 |
/** @var Swagger_Builder_Interface $endpoint */
|
133 |
-
$endpoint =
|
134 |
|
135 |
register_rest_route( $this->namespace, '/doc', [
|
136 |
'methods' => WP_REST_Server::READABLE,
|
42 |
$this->container->singleton( 'pods.rest-v1.validator', Base_Validator::class );
|
43 |
$this->container->singleton( 'pods.rest-v1.repository', Post_Repository::class );
|
44 |
|
45 |
+
$messages = pods_container( 'pods.rest-v1.messages' );
|
46 |
+
$post_repository = pods_container( 'pods.rest-v1.repository' );
|
47 |
+
$validator = pods_container( 'pods.rest-v1.validator' );
|
48 |
|
49 |
$endpoints = $this->get_endpoints();
|
50 |
|
96 |
*/
|
97 |
public function register_endpoints() {
|
98 |
/** @var Main $main */
|
99 |
+
$main = pods_container( 'pods.rest-v1.main' );
|
100 |
|
101 |
$this->namespace = $main->get_pods_route_namespace();
|
102 |
|
108 |
}
|
109 |
|
110 |
try {
|
111 |
+
$endpoint_obj = pods_container( $key );
|
112 |
|
113 |
if ( method_exists( $endpoint_obj, 'register_routes' ) ) {
|
114 |
$endpoint_obj->register_routes( $this->namespace, true );
|
130 |
*/
|
131 |
protected function register_endpoint_documentation() {
|
132 |
/** @var Swagger_Builder_Interface $endpoint */
|
133 |
+
$endpoint = pods_container( 'pods.rest-v1.endpoints.documentation' );
|
134 |
|
135 |
register_rest_route( $this->namespace, '/doc', [
|
136 |
'methods' => WP_REST_Server::READABLE,
|
ui/forms/form.php
CHANGED
@@ -174,7 +174,7 @@ if ( 0 < $pod->id() ) {
|
|
174 |
}
|
175 |
}
|
176 |
|
177 |
-
$static_cache =
|
178 |
|
179 |
$counter = (int) $static_cache->get( $pod->pod . '-counter', 'pods-forms' );
|
180 |
|
174 |
}
|
175 |
}
|
176 |
|
177 |
+
$static_cache = pods_container( Static_Cache::class );
|
178 |
|
179 |
$counter = (int) $static_cache->get( $pod->pod . '-counter', 'pods-forms' );
|
180 |
|