WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ive picked up an old plugin and am needing to enhance it for my clients specific needs.

In the admin section there is a text area used to add info about a download (essentially a custom post type). However the description field is a simple text area, and so only text is stored. The client need to be able to use this in a similar fashion to the post or blog editor elsewhere in WP. Primarily it needs to add new lines and formatting without the need to manually add html.

So, from my limited knowledge of WP I'm assuming that the way forward is to some how tell WP to make this utilise the TinyMCE...

Here is the function used to create the in the relevant admin page;

    public function display_sdm_description_meta_box($post) {  // Description metabox
    _e('Add a description for this download item.', 'sdm_lang');
    echo '<br /><br />';

    $old_description = get_post_meta($post->ID, 'sdm_description', true);
    <textarea id="sdm_description" name="sdm_description" style="width:60%;height:100px;"><?php echo $old_description; ?></textarea>
    wp_nonce_field('sdm_description_box_nonce', 'sdm_description_box_nonce_check');

If someone could show me how to adapt this code to get the required result, I'd be really grateful.

Thanks in advance!

share|improve this question
up vote 1 down vote accepted

You need to use wp_editor()

$old_description = get_post_meta($post->ID, 'sdm_description', true); 
$editor_id = 'sdm_description';
$settings = array( 'media_buttons' => false );

wp_editor( $old_description , $editor_id, $settings );
share|improve this answer
Thanks @helgatheviking !!!! – Phill Healey Aug 14 '14 at 11:30
Ive got a related issue now. Please take a look at the following link. Hopefully you can help me out. Thanks! wordpress.stackexchange.com/questions/157823/… – Phill Healey Aug 14 '14 at 12:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.