Created
December 5, 2012 21:18
-
-
Save cernalpanic/4219594 to your computer and use it in GitHub Desktop.
how to debug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debug_this($args) { | |
print_r($args); | |
} | |
add_filter( 'attachment_fields_to_save', 'RE_attachment_field_version_save', 10, 2 ); | |
function RE_attachment_field_version_save( $post, $attachment ) { | |
debug_this(get_post_ancestors($post['ID'])); | |
if( isset( $attachment['re-current-version'] ) ) { | |
//let's remove the current version setting in the db for this attachment type | |
//update_post_meta( get_post_ancestors($post['ID'])[0]), 're-current-version', $attachment['re-current-version'] ); | |
//update_post_meta( $post['ID'], 're-currnt-version', 0 ); | |
update_post_meta( $post['ID'], 're-current-version', $attachment['re-current-version'] ); | |
} | |
return $post; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment