[ad_1]
I want to add a class to the description field in an image.
This is my code, but it doesn’t seem to be doing anything. Can anyone help?
function custom_image_description_class($form_fields, $post) {
$form_fields[‘post_content’][‘label’] = ‘Description’;
$form_fields[‘post_content’][‘input’] = ‘textarea’;
$form_fields[‘post_content’][‘class’] = ‘my-class’;
return $form_fields;
}
add_filter(‘attachment_fields_to_edit’, ‘custom_image_description_class’, 10, 2);
