Permalink
Browse files

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

  • Loading branch information...
2 parents 71a003a + 975f478 commit c5ecae10f7876dafc378c51b41be395693d9cab6 @mikedamage mikedamage committed Aug 1, 2012
Showing with 22 additions and 13 deletions.
  1. +5 −2 classes/PodsAPI.php
  2. +2 −9 classes/PodsMeta.php
  3. +15 −2 functions.php
View
@@ -897,7 +897,7 @@ public function save_pod ( $params ) {
$built_in_object = str_replace( array( 'built_in_post_types_', 'built_in_taxonomies_' ), '', $key );
- $built_in[ $built_in_type ][ $built_in_object ] = max( pods_absint( $val ), 1 );
+ $built_in[ $built_in_type ][ $built_in_object ] = (int) $val;
}
$lookup_option = $lookup_built_in = false;
@@ -915,7 +915,10 @@ public function save_pod ( $params ) {
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;
+ $search_val = 1;
+
+ if ( 1 == $val )
+ $search_val = 0;
$query = "SELECT p.ID FROM {$wpdb->posts} AS p
LEFT JOIN {$wpdb->postmeta} AS pm ON pm.post_id = p.ID AND pm.meta_key = '{$lookup_option}'
View
@@ -326,13 +326,7 @@ public function save_post ( $post_id, $post ) {
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || in_array( $post->post_type, $blacklisted_types ) )
return $post_id;
- $recursion_fix = false;
-
- if ( has_action( 'save_post', array( $this, 'save_post' ), 10, 2 ) ) {
- remove_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
-
- $recursion_fix = true;
- }
+ pods_no_conflict_on( 'post' );
$groups = $this->groups_get( 'post_type', $post->post_type );
@@ -360,8 +354,7 @@ public function save_post ( $post_id, $post ) {
if ( !empty( $pod ) )
$pod->save( $data );
- if ( $recursion_fix )
- add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
+ pods_no_conflict_off( 'post' );
return $post_id;
}
View
@@ -1281,6 +1281,8 @@ function pods_no_conflict_on ( $object_type = 'post' ) {
$no_conflict = array();
+ // Filters = Usually get/update/delete meta functions
+ // Actions = Usually insert/update/save/delete object functions
if ( 'post' == $object_type ) {
$no_conflict[ 'filter' ] = array(
@@ -1300,13 +1302,23 @@ function pods_no_conflict_on ( $object_type = 'post' ) {
array( 'create_term', array( PodsInit::$meta, 'save_taxonomy' ), 10, 3 )
);
}
+ elseif ( 'media' == $object_type ) {
+ $no_conflict[ 'filter' ] = array(
+ array( 'wp_update_attachment_metadata', array( PodsInit::$meta, 'save_media' ), 10, 2 )
+ );
+
+ $no_conflict[ 'action' ] = array(
+
+ );
+ }
elseif ( 'user' == $object_type ) {
$no_conflict[ 'filter' ] = array(
);
$no_conflict[ 'action' ] = array(
-
+ array( 'personal_options_update', array( PodsInit::$meta, 'save_user' ) ),
+ array( 'edit_user_profile_update', array( PodsInit::$meta, 'save_user' ) )
);
}
elseif ( 'comment' == $object_type ) {
@@ -1315,7 +1327,8 @@ function pods_no_conflict_on ( $object_type = 'post' ) {
);
$no_conflict[ 'action' ] = array(
-
+ array( 'wp_insert_comment', array( PodsInit::$meta, 'save_comment' ) ),
+ array( 'edit_comment', array( PodsInit::$meta, 'save_comment' ) )
);
}

0 comments on commit c5ecae1

Please sign in to comment.