Using quicktags in widget textarea
-
Hi,
My question is simple: how to add quicktags to a textarea which is located inside a widget?
I have found a very useful tutorial and it works, but not for textarea’s which are located inside a widget. This because each widget has it’s own ID.
My plugin functions file:
function my_custom_quicktags() { wp_enqueue_script( 'quicktag_script', plugins_url( '/js/quicktags.js' , __FILE__ ), array('quicktags') ); } add_action( 'admin_print_scripts', 'my_custom_quicktags' );
My quicktags.js file:
jQuery(document).ready(function() { quicktags({ id: 'my_textarea_id', buttons: 'em,strong,link' }); });
Textarea ID inside my widget file:
id="<?php echo $this->get_field_id('text'); ?>"
So, how to get textarea ID in my quicktags.js file?
Guido
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Using quicktags in widget textarea’ is closed to new replies.