G2A Many GEOs
SHARE
TWEET

Changing WP Media Gallery Fields

liperuf Apr 26th, 2011 236 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function custom_media_gallery_fields($form_fields, $post) {
  2.         $form_fields["custom_link"] = array(
  3.                 "label" => __("External URL"),
  4.                 "input" => "text",
  5.                 "value" => get_post_meta($post->ID, "_custom_link", true), // save as meta
  6.                 "helps" => __("Your external link.")
  7.         );
  8.        
  9.         unset( $form_fields['url'] ); // [optional] remove original URL field
  10.        
  11.         return $form_fields;
  12. }
  13. add_filter("attachment_fields_to_edit", "custom_media_gallery_fields", null, 2);
RAW Paste Data
Ledger Nano X - The secure hardware wallet
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
Top