Created
July 13, 2012 03:34
-
-
Save vickybiswas/3102546 to your computer and use it in GitHub Desktop.
Convert Caption in Attachments to a RTE
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
function vicky($form_fields) { | |
preg_match('/name="([^"]*)/', $form_fields["post_excerpt"]["html"], $matches); | |
$args = array("textarea_name" => $matches[1], "media_buttons" => false, 'quicktags' => true, 'textarea_rows' => '5'); | |
preg_match('/>(.*)</', $form_fields["post_excerpt"]["html"], $matches); | |
ob_start(); | |
wp_editor( html_entity_decode($matches[1]), "wpet_options[textarea_one]", $args ); | |
$html = ob_get_clean(); | |
$form_fields["post_excerpt"]["input"] = "html"; | |
$form_fields["post_excerpt"]["html"] = $html; | |
return $form_fields; | |
} | |
add_filter("attachment_fields_to_edit", "vicky"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment