Opened 5 years ago
Closed 3 years ago
#1746 closed defect (worksforme)
Filter attachment_fields_to_edit
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | lowest | |
Component: | General | Keywords: | has-screenshots |
Cc: |
Description
Filter attachment_fields_to_edit display not necessary required field message.
Exemple :
add_filter('attachment_fields_to_edit', 'theme_attachment_fields_to_edit', 10, 2); function theme_attachment_fields_to_edit($form_fields, $post) { $form_fields['theme-custom-attachment-field-url'] = array( 'label' => __('Custom URL'), 'input' => 'text', 'required' => false, 'value' => get_post_meta($post->ID, 'theme_custom_attachment_field_url', true), 'helps' => '' //__('Enter the destination URL') ); return $form_fields; }
Source of the bug :
// wp-admin/includes/media.php lines 1743 to1749 if ( $item ) { $item = '<p class="media-types media-types-required-info">' . sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . '</p> <table class="compat-attachment-fields">' . $item . '</table>'; }
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
screenshot