Created
May 18, 2019 17:23
-
-
Save Asikur22/044979047be3323272f954e022b0f20d to your computer and use it in GitHub Desktop.
Add New Field To Attachment #Metabox #CustomMetabox
This file contains hidden or 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
/* | |
* Show Image Id on Media Edit | |
*/ | |
function ibenic_add_media_custom_field( $form_fields, $post ) { | |
$form_fields['info_ID'] = array( | |
'label' => __( 'Image ID' ), | |
'input' => 'html', | |
'html' => "<input type='text' class='text' readonly='readonly' onfocus='this.select();' value='" . esc_attr( $post->ID ) . "' /><br />", | |
); | |
return $form_fields; | |
} | |
add_filter( 'attachment_fields_to_edit', 'ibenic_add_media_custom_field', null, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment