Pods – Custom Content Types and Fields - Version 2.8.7

Version Description

  • December 1st, 2021 =

  • Fixed: Solved issue where some shortcodes were not processed properly in templates. #6337 (@sc0ttkclark)

  • Fixed: Prevent conflicts with get_metadata integrations causing recursive loops. (@sc0ttkclark)

Download this release

Release Info

Developer sc0ttkclark
Plugin Icon 128x128 Pods – Custom Content Types and Fields
Version 2.8.7
Comparing to
See all releases

Code changes from version 2.8.6 to 2.8.7

Files changed (5) hide show
  1. classes/PodsInit.php +11 -2
  2. classes/PodsMeta.php +51 -11
  3. includes/general.php +2 -2
  4. init.php +2 -2
  5. readme.txt +6 -1
classes/PodsInit.php CHANGED
@@ -1278,6 +1278,8 @@ class PodsInit {
1278
  $force = true;
1279
  }
1280
 
 
 
1281
  if ( false === $pods_cpt_ct || $force ) {
1282
  /**
1283
  * @var WP_Query
@@ -1752,6 +1754,8 @@ class PodsInit {
1752
  }
1753
  }//end if
1754
 
 
 
1755
  foreach ( $pods_cpt_ct['taxonomies'] as $taxonomy => $options ) {
1756
  // Check for a skipped type.
1757
  if ( empty( $options ) ) {
@@ -1951,6 +1955,11 @@ class PodsInit {
1951
 
1952
  do_action( 'pods_setup_content_types' );
1953
 
 
 
 
 
 
1954
  if ( $save_transient ) {
1955
  /**
1956
  * Allow hooking into after Pods has been setup.
@@ -1967,10 +1976,10 @@ class PodsInit {
1967
  * Check if we need to flush WordPress rewrite rules
1968
  * This gets run during 'init' action late in the game to give other plugins time to register their rewrite rules
1969
  */
1970
- public function flush_rewrite_rules() {
1971
 
1972
  // Only run $wp_rewrite->flush_rules() in an admin context.
1973
- if ( ! is_admin() ) {
1974
  return;
1975
  }
1976
 
1278
  $force = true;
1279
  }
1280
 
1281
+ $original_cpt_ct = $pods_cpt_ct;
1282
+
1283
  if ( false === $pods_cpt_ct || $force ) {
1284
  /**
1285
  * @var WP_Query
1754
  }
1755
  }//end if
1756
 
1757
+ $is_changed = $pods_cpt_ct !== $original_cpt_ct;
1758
+
1759
  foreach ( $pods_cpt_ct['taxonomies'] as $taxonomy => $options ) {
1760
  // Check for a skipped type.
1761
  if ( empty( $options ) ) {
1955
 
1956
  do_action( 'pods_setup_content_types' );
1957
 
1958
+ // Maybe set the rewrites to be flushed.
1959
+ if ( $is_changed ) {
1960
+ pods_transient_set( 'pods_flush_rewrites', 1, WEEK_IN_SECONDS );
1961
+ }
1962
+
1963
  if ( $save_transient ) {
1964
  /**
1965
  * Allow hooking into after Pods has been setup.
1976
  * Check if we need to flush WordPress rewrite rules
1977
  * This gets run during 'init' action late in the game to give other plugins time to register their rewrite rules
1978
  */
1979
+ public function flush_rewrite_rules( $force = false ) {
1980
 
1981
  // Only run $wp_rewrite->flush_rules() in an admin context.
1982
+ if ( ! $force && ! is_admin() ) {
1983
  return;
1984
  }
1985
 
classes/PodsMeta.php CHANGED
@@ -630,7 +630,7 @@ class PodsMeta {
630
  return true;
631
  }
632
 
633
- if ( ! is_array( $pod ) && ! $pod instanceof Pods\Whatsit ) {
634
  if ( empty( self::$current_pod_data ) || ! is_object( self::$current_pod_data ) || self::$current_pod_data['name'] != $pod ) {
635
  self::$current_pod_data = pods_api()->load_pod( array( 'name' => $pod ), false );
636
  }
@@ -2712,11 +2712,19 @@ class PodsMeta {
2712
 
2713
  $_null = apply_filters( 'pods_meta_get_post_meta', null, $args );
2714
 
2715
- if ( null !== $_null ) {
 
 
2716
  return $_null;
2717
  }
2718
 
2719
- return call_user_func_array( array( $this, 'get_meta' ), $args );
 
 
 
 
 
 
2720
  }
2721
 
2722
  /**
@@ -2729,11 +2737,19 @@ class PodsMeta {
2729
 
2730
  $_null = apply_filters( 'pods_meta_get_user_meta', null, $args );
2731
 
2732
- if ( null !== $_null ) {
 
 
2733
  return $_null;
2734
  }
2735
 
2736
- return call_user_func_array( array( $this, 'get_meta' ), $args );
 
 
 
 
 
 
2737
  }
2738
 
2739
  /**
@@ -2746,11 +2762,19 @@ class PodsMeta {
2746
 
2747
  $_null = apply_filters( 'pods_meta_get_comment_meta', null, $args );
2748
 
2749
- if ( null !== $_null ) {
 
 
2750
  return $_null;
2751
  }
2752
 
2753
- return call_user_func_array( array( $this, 'get_meta' ), $args );
 
 
 
 
 
 
2754
  }
2755
 
2756
  /**
@@ -2763,11 +2787,19 @@ class PodsMeta {
2763
 
2764
  $_null = apply_filters( 'pods_meta_get_term_meta', null, $args );
2765
 
2766
- if ( null !== $_null ) {
 
 
2767
  return $_null;
2768
  }
2769
 
2770
- return call_user_func_array( array( $this, 'get_meta' ), $args );
 
 
 
 
 
 
2771
  }
2772
 
2773
  /**
@@ -2786,11 +2818,19 @@ class PodsMeta {
2786
 
2787
  $_null = apply_filters( 'pods_meta_get_option', null, $args );
2788
 
2789
- if ( null !== $_null ) {
 
 
2790
  return $_null;
2791
  }
2792
 
2793
- return call_user_func_array( array( $this, 'get_meta' ), $args );
 
 
 
 
 
 
2794
  }
2795
 
2796
  /**
630
  return true;
631
  }
632
 
633
+ if ( ! is_array( $pod ) && ! $pod instanceof Pod ) {
634
  if ( empty( self::$current_pod_data ) || ! is_object( self::$current_pod_data ) || self::$current_pod_data['name'] != $pod ) {
635
  self::$current_pod_data = pods_api()->load_pod( array( 'name' => $pod ), false );
636
  }
2712
 
2713
  $_null = apply_filters( 'pods_meta_get_post_meta', null, $args );
2714
 
2715
+ static $no_conflict = false;
2716
+
2717
+ if ( null !== $_null || $no_conflict ) {
2718
  return $_null;
2719
  }
2720
 
2721
+ $no_conflict = true;
2722
+
2723
+ $return = call_user_func_array( array( $this, 'get_meta' ), $args );
2724
+
2725
+ $no_conflict = false;
2726
+
2727
+ return $return;
2728
  }
2729
 
2730
  /**
2737
 
2738
  $_null = apply_filters( 'pods_meta_get_user_meta', null, $args );
2739
 
2740
+ static $no_conflict = false;
2741
+
2742
+ if ( null !== $_null || $no_conflict ) {
2743
  return $_null;
2744
  }
2745
 
2746
+ $no_conflict = true;
2747
+
2748
+ $return = call_user_func_array( array( $this, 'get_meta' ), $args );
2749
+
2750
+ $no_conflict = false;
2751
+
2752
+ return $return;
2753
  }
2754
 
2755
  /**
2762
 
2763
  $_null = apply_filters( 'pods_meta_get_comment_meta', null, $args );
2764
 
2765
+ static $no_conflict = false;
2766
+
2767
+ if ( null !== $_null || $no_conflict ) {
2768
  return $_null;
2769
  }
2770
 
2771
+ $no_conflict = true;
2772
+
2773
+ $return = call_user_func_array( array( $this, 'get_meta' ), $args );
2774
+
2775
+ $no_conflict = false;
2776
+
2777
+ return $return;
2778
  }
2779
 
2780
  /**
2787
 
2788
  $_null = apply_filters( 'pods_meta_get_term_meta', null, $args );
2789
 
2790
+ static $no_conflict = false;
2791
+
2792
+ if ( null !== $_null || $no_conflict ) {
2793
  return $_null;
2794
  }
2795
 
2796
+ $no_conflict = true;
2797
+
2798
+ $return = call_user_func_array( array( $this, 'get_meta' ), $args );
2799
+
2800
+ $no_conflict = false;
2801
+
2802
+ return $return;
2803
  }
2804
 
2805
  /**
2818
 
2819
  $_null = apply_filters( 'pods_meta_get_option', null, $args );
2820
 
2821
+ static $no_conflict = false;
2822
+
2823
+ if ( null !== $_null || $no_conflict ) {
2824
  return $_null;
2825
  }
2826
 
2827
+ $no_conflict = true;
2828
+
2829
+ $return = call_user_func_array( array( $this, 'get_meta' ), $args );
2830
+
2831
+ $no_conflict = false;
2832
+
2833
+ return $return;
2834
  }
2835
 
2836
  /**
includes/general.php CHANGED
@@ -1507,13 +1507,13 @@ function pods_do_shortcode( $content, $shortcodes = [], $ignored_shortcodes = []
1507
  $ignore_shortcodes = ! empty( $ignored_shortcodes );
1508
 
1509
  if ( $only_shortcodes || $ignore_shortcodes ) {
1510
- $temp_shortcode_filter = function ( $return, $tag, $attr, $m ) use ( $only_shortcodes, $shortcodes, $ignore_shortcodes, $ignored_shortcodes ) {
1511
  if ( $only_shortcodes && in_array( $m[2], $shortcodes, true ) ) {
1512
  // If shortcode being called is in list, return false to allow it to run.
1513
  return false;
1514
  }
1515
 
1516
- if ( ! $ignore_shortcodes || ! in_array( $m[2], $ignored_shortcodes, true ) ) {
1517
  // If shortcode being called is not in ignore list, return false to allow it to run.
1518
  return false;
1519
  }
1507
  $ignore_shortcodes = ! empty( $ignored_shortcodes );
1508
 
1509
  if ( $only_shortcodes || $ignore_shortcodes ) {
1510
+ $temp_shortcode_filter = static function ( $return, $tag, $attr, $m ) use ( $only_shortcodes, $shortcodes, $ignore_shortcodes, $ignored_shortcodes ) {
1511
  if ( $only_shortcodes && in_array( $m[2], $shortcodes, true ) ) {
1512
  // If shortcode being called is in list, return false to allow it to run.
1513
  return false;
1514
  }
1515
 
1516
+ if ( $ignore_shortcodes && ! in_array( $m[2], $ignored_shortcodes, true ) ) {
1517
  // If shortcode being called is not in ignore list, return false to allow it to run.
1518
  return false;
1519
  }
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.6
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.6' );
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.7
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.7' );
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: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 2.8.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -151,6 +151,11 @@ Pods really wouldn't be where it is without all the contributions from our [dono
151
 
152
  == Changelog ==
153
 
 
 
 
 
 
154
  = 2.8.6 - November 30th, 2021 =
155
 
156
  * Security: Escape/KSES labels and descriptions in more places. (@sc0ttkclark)
5
  Requires at least: 5.5
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 2.8.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
151
 
152
  == Changelog ==
153
 
154
+ = 2.8.7 - December 1st, 2021 =
155
+
156
+ * Fixed: Solved issue where some shortcodes were not processed properly in templates. #6337 (@sc0ttkclark)
157
+ * Fixed: Prevent conflicts with get_metadata integrations causing recursive loops. (@sc0ttkclark)
158
+
159
  = 2.8.6 - November 30th, 2021 =
160
 
161
  * Security: Escape/KSES labels and descriptions in more places. (@sc0ttkclark)