Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 71a003a37fc28eb7176f20433bd0963131c860f2 2 parents d55854c + 1b6d64a
Mike Green mikedamage authored
Showing with 63 additions and 6 deletions.
  1. +3 −3 classes/PodsAPI.php
  2. +2 −2 classes/PodsInit.php
  3. +58 −1 functions.php
6 classes/PodsAPI.php
View
@@ -882,9 +882,9 @@ public function save_pod ( $params ) {
foreach ( $pod[ 'options' ] as $key => $val ) {
if ( false === strpos( $key, 'built_in_' ) )
continue;
- elseif ( false === strpos( $key, 'built_in_post_types_' ) )
+ elseif ( false !== strpos( $key, 'built_in_post_types_' ) )
$built_in_type = 'post_type';
- elseif ( false === strpos( $key, 'built_in_taxonomies_' ) )
+ elseif ( false !== strpos( $key, 'built_in_taxonomies_' ) )
$built_in_type = 'taxonomy';
else
continue;
@@ -913,7 +913,7 @@ public function save_pod ( $params ) {
$lookup_built_in = 'post_type';
}
- if ( !empty( $lookup_option ) && !empty( $lookup_built_in ) && isset( $built_in[ $lookup_built_in ] ) && !empty( $built_in[ $lookup_built_in ] ) ) {
+ if ( !empty( $lookup_option ) && !empty( $lookup_built_in ) && isset( $built_in[ $lookup_built_in ] ) ) {
foreach ( $built_in[ $lookup_built_in ] as $built_in_object => $val ) {
$search_val = 1 ^ $val;
4 classes/PodsInit.php
View
@@ -3,7 +3,7 @@ class PodsInit {
static $no_conflict = array();
- public $meta;
+ static $meta;
public $version;
@@ -36,7 +36,7 @@ function __construct () {
add_action( 'wp_before_admin_bar_render', array( $this, 'admin_bar_links' ) );
// Init Pods Meta
- $this->meta = pods_meta()->init();
+ self::$meta = pods_meta()->init();
}
}
59 functions.php
View
@@ -1268,7 +1268,7 @@ function pods_is_plugin_active ( $plugin ) {
}
/**
- * Turn off conflicting / recursing actions for an object type that Pods hooks into
+ * Turn off conflicting / recursive actions for an object type that Pods hooks into
*
* @param string $object_type
*/
@@ -1276,8 +1276,55 @@ 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;
+ if ( !is_object( PodsInit::$meta ) )
+ return;
+
$no_conflict = array();
+ if ( 'post' == $object_type ) {
+ $no_conflict[ 'filter' ] = array(
+
+ );
+
+ $no_conflict[ 'action' ] = array(
+ array( 'save_post', array( PodsInit::$meta, 'save_post' ), 10, 2 )
+ );
+ }
+ elseif ( 'taxonomy' == $object_type ) {
+ $no_conflict[ 'filter' ] = array(
+
+ );
+
+ $no_conflict[ 'action' ] = array(
+ array( 'edit_term', array( PodsInit::$meta, 'save_taxonomy' ), 10, 3 ),
+ array( 'create_term', array( PodsInit::$meta, 'save_taxonomy' ), 10, 3 )
+ );
+ }
+ elseif ( 'user' == $object_type ) {
+ $no_conflict[ 'filter' ] = array(
+
+ );
+
+ $no_conflict[ 'action' ] = array(
+
+ );
+ }
+ elseif ( 'comment' == $object_type ) {
+ $no_conflict[ 'filter' ] = array(
+
+ );
+
+ $no_conflict[ 'action' ] = array(
+
+ );
+ }
+
+ foreach ( $no_conflict as $action_filter => $conflicts ) {
+ foreach ( $conflicts as $args ) {
+ call_user_func_array( 'remove_' . $action_filter, $args );
+ }
+ }
+
PodsInit::$no_conflict[ $object_type ] = $no_conflict;
}
@@ -1290,5 +1337,15 @@ 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;
+ if ( !is_object( PodsInit::$meta ) )
+ return;
+
$no_conflict = PodsInit::$no_conflict[ $object_type ];
+
+ foreach ( $no_conflict as $action_filter => $conflicts ) {
+ foreach ( $conflicts as $args ) {
+ if ( call_user_func_array( 'has_' . $action_filter, $args ) )
+ call_user_func_array( 'add_' . $action_filter, $args );
+ }
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.