Permalink
Browse files

Pods no conflict function start

  • Loading branch information...
1 parent 97354ff commit c6f0581ade1825574f1d8d58090f9f9c0fe2620c @sc0ttkclark sc0ttkclark committed Aug 1, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 functions.php
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 c6f0581

Please sign in to comment.