Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pods no conflict function start

  • Loading branch information...
commit c6f0581ade1825574f1d8d58090f9f9c0fe2620c 1 parent 97354ff
@sc0ttkclark sc0ttkclark authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 functions.php
View
26 functions.php
@@ -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 ];
}
Please sign in to comment.
Something went wrong with that request. Please try again.