Definition:
function image_attachment_fields_to_edit($form_fields, $post) {}
Parameters
- unknown_type $form_fields
- unknown_type $post
Source code
function image_attachment_fields_to_edit($form_fields, $post) { if ( substr($post->post_mime_type, 0, 5) == 'image' ) { $alt = get_post_meta($post->ID, '_wp_attachment_image_alt', true); if ( empty($alt) ) $alt = ''; $form_fields['post_title']['required'] = true; $form_fields['image_alt'] = array( 'value' => $alt, 'label' => __('Alternate Text'), 'helps' => __('Alt text for the image, e.g. “The Mona Lisa”') ); $form_fields['align'] = array( 'label' => __('Alignment'), 'input' => 'html', 'html' => image_align_input_fields($post, get_option('image_default_align')), ); $form_fields['image-size'] = image_size_input_fields( $post, get_option('image_default_size', 'medium') ); } else { unset( $form_fields['image_alt'] ); } return $form_fields; }
1979
No comments yet... Be the first to leave a reply!