Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created June 13, 2012 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/2924155 to your computer and use it in GitHub Desktop.
Save billerickson/2924155 to your computer and use it in GitHub Desktop.
<?php
/**
* Hidden fields on media uploader
*
* @param $post array, the post data for database
* @param $attachment array, attachment fields from $_POST form
* @return $post array, modified post data
*/
function be_attachment_hidden_field_save( $post, $attachment ) {
update_post_meta( $post['ID'], 'be_show_this', 'true' );
return $post;
}
add_filter( 'attachment_fields_to_save', 'be_attachment_hidden_field_save', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment