Ledger Nano X - The secure hardware wallet

Saving WP Media Gallery custom fields

liperuf Apr 26th, 2011 179 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function save_custom_media_gallery_fields($post, $attachment) {
  2.         if( isset($attachment['custom_link']) ){
  3.                 update_post_meta($post['ID'], '_custom_link', $attachment['custom_link']);
  4.         }
  5.         return $post;
  6. }
  7. add_filter("attachment_fields_to_save", "save_custom_media_gallery_fields", null , 2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand