0

I created some custom fields with function.php, but I want to add visual editor to them (like in posts or whatever). Is this possible? This is my field

woocommerce_wp_textarea_input(
 array(
  'id'          => 'seo_textarea',
  'label'       => __( 'SEO', 'woocommerce' ),
  'placeholder' => '')
);

And i want to add something like this

1 Answers1

0
wp_editor(
$distribution,
'distribution',
array(
  'media_buttons' => false,
  'textarea_rows' => 8,
  'tabindex' => 4,
  'tinymce' => array(
    'theme_advanced_buttons1' => 'bold, italic, ul, min_size, max_size',
    'theme_advanced_buttons2' => '',
    'theme_advanced_buttons3' => '',
    'theme_advanced_buttons4' => '',
  ),
));

instead of using woocommerce_wp_textarea_input you can use this above to accomplish your task.

or method 2 you would use this for me both work fine.

$settings = array(
'tinymce'       => array(
    'setup' => 'function (ed) {
        tinymce.documentBaseURL = "' . get_admin_url() . '";
    }',
),
'quicktags'     => TRUE,
'editor_class'  => 'frontend-article-editor',
'textarea_rows' => 25,
'media_buttons' => TRUE,);wp_editor( $content, 'article_content', $settings ); 

Hope this might help you.

Tehseen Ahmed
  • 147
  • 3
  • 15