[wp-meta] [Making WordPress.org] #1746: Filter attachment_fields_to_edit

Making WordPress.org noreply at wordpress.org
Fri Jun 3 13:58:23 UTC 2016


#1746: Filter attachment_fields_to_edit
------------------------------+-----------------------------
 Reporter:  robertoentringer  |      Owner:
     Type:  defect            |     Status:  new
 Priority:  lowest            |  Milestone:
Component:  General           |   Keywords:  has-screenshots
------------------------------+-----------------------------
 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>';
         }
 }}}

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/1746>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list