Permalink
Browse files

Merge branch '2.0' of https://github.com/pods-framework/pods into 2.0

  • Loading branch information...
2 parents b41856a + c6f0581 commit b6c99fd9163e636438c0f98d58df3c9930dab44f @mikedamage mikedamage committed Aug 1, 2012
Showing with 30 additions and 2 deletions.
  1. +2 −2 classes/PodsAPI.php
  2. +2 −0 classes/PodsInit.php
  3. +26 −0 functions.php
View
@@ -904,11 +904,11 @@ public function save_pod ( $params ) {
$lookup_name = $pod[ 'name' ];
- if ( 'post_type' == $pod[ 'type' ] && isset( $built_in[ $pod[ 'type' ] ] ) ) {
+ if ( 'post_type' == $pod[ 'type' ] && isset( $built_in[ 'taxonomy' ] ) ) {
$lookup_option = 'built_in_post_types_' . $lookup_name;
$lookup_built_in = 'taxonomy';
}
- elseif ( 'taxonomy' == $pod[ 'type' ] && isset( $built_in[ $pod[ 'type' ] ] ) ) {
+ elseif ( 'taxonomy' == $pod[ 'type' ] && isset( $built_in[ 'post_type' ] ) ) {
$lookup_option = 'built_in_taxonomies_' . $lookup_name;
$lookup_built_in = 'post_type';
}
View
@@ -1,6 +1,8 @@
<?php
class PodsInit {
+ static $no_conflict = array();
+
public $meta;
public $version;
View
@@ -1265,4 +1265,30 @@ function pods_is_plugin_active ( $plugin ) {
return true;
return false;
+}
+
+/**
+ * Turn off conflicting / recursing actions for an object type that Pods hooks into
+ *
+ * @param string $object_type
+ */
+function pods_no_conflict_on ( $object_type = 'post' ) {
+ if ( !empty( PodsInit::$no_conflict ) && isset( PodsInit::$no_conflict[ $object_type ] ) && !empty( PodsInit::$no_conflict[ $object_type ] ) )
+ return;
+
+ $no_conflict = array();
+
+ PodsInit::$no_conflict[ $object_type ] = $no_conflict;
+}
+
+/**
+ * Turn on actions after running code during pods_conflict
+ *
+ * @param string $object_type
+ */
+function pods_no_conflict_off ( $object_type = 'post' ) {
+ if ( empty( PodsInit::$no_conflict ) || !isset( PodsInit::$no_conflict[ $object_type ] ) || empty( PodsInit::$no_conflict[ $object_type ] ) )
+ return;
+
+ $no_conflict = PodsInit::$no_conflict[ $object_type ];
}

0 comments on commit b6c99fd

Please sign in to comment.