wp_editor textarea value not updating
-
I am using the *_add_form_fields action to add fields to the edit/add term page. One of those fields is a wp_editor().
The problem I am facing is that when I output the WordPress editor on the page like so:
wp_editor('test', 'mydescription', array('textarea_name' => 'my_description'));
and then if I click in the editor on the page and change the default value from
test
tosomething else
the$_POST['my_description']
variable is still set totest
Should I be adding an additional setting to my editor? Is there a reason why I cannot change the value of the textarea?
Below is a simple test case that shows this. You can paste this code at the top of
twentyeleven/functions.php
in a default install of
WordPress. Then visit the add tag page and try to add a tag. You will notice that the posted value formy_description
will not change…class Test{ function __construct() { add_action('add_tag_form_fields', array($this, 'add_tag_form_fields')); add_action('created_term', array($this, 'created_term')); } function add_tag_form_fields($tag){ if ( current_user_can( 'publish_posts' ) ): wp_editor('test', 'mydescription', array('textarea_name' => 'my_description')); endif; } function created_term($tag){ echo '<pre>'; print_r($_POST); echo '</pre>'; die(); } } new Test();
- The topic ‘wp_editor textarea value not updating’ is closed to new replies.