Skip to content
Browse files

Adding the new $update available for save_post in WP 3.6 just committ…

  • Loading branch information...
1 parent c7e4b66 commit b55c8b3b936e11f5a6926ba8fbb0672c82c76346 @sc0ttkclark sc0ttkclark committed
Showing with 8 additions and 5 deletions.
  1. +8 −5 classes/PodsMeta.php
View
13 classes/PodsMeta.php
@@ -120,7 +120,7 @@ public function core () {
add_action( 'add_meta_boxes', array( $this, 'meta_post_add' ) );
add_action( 'transition_post_status', array( $this, 'save_post_detect_new' ), 10, 3 );
- add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
+ add_action( 'save_post', array( $this, 'save_post' ), 10, 3 );
if ( apply_filters( 'pods_meta_handler', true, 'post' ) ) {
// Handle *_post_meta
@@ -539,8 +539,8 @@ public function group_add ( $pod, $label, $fields, $context = 'normal', $priorit
if ( !has_action( 'add_meta_boxes', array( $this, 'meta_post_add' ) ) )
add_action( 'add_meta_boxes', array( $this, 'meta_post_add' ) );
- /*if ( !has_action( 'save_post', array( $this, 'save_post' ), 10, 2 ) )
- add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );*/
+ /*if ( !has_action( 'save_post', array( $this, 'save_post' ), 10, 3 ) )
+ add_action( 'save_post', array( $this, 'save_post' ), 10, 3 );*/
}
elseif ( 'taxonomy' == $pod[ 'type' ] ) {
if ( !has_action( $pod[ 'object' ] . '_edit_form_fields', array( $this, 'meta_taxonomy' ), 10, 2 ) ) {
@@ -835,13 +835,16 @@ public function save_post_detect_new ( $new_status, $old_status, $post ) {
/**
* @param $post_id
* @param $post
+ * @param $update
*
* @return mixed
*/
- public function save_post ( $post_id, $post ) {
+ public function save_post ( $post_id, $post, $update = null ) {
$is_new_item = false;
- if ( 'new' == self::$old_post_status )
+ if ( is_bool( $update ) )
+ $is_new_item = $update;
+ elseif ( 'new' == self::$old_post_status )
$is_new_item = true;
// Reset to avoid manual new post issues

0 comments on commit b55c8b3

Please sign in to comment.
Something went wrong with that request. Please try again.