R
R
Roman Savitsky2016-03-26 19:17:10
WordPress
Roman Savitsky, 2016-03-26 19:17:10

How to add a simple visual editor to a custom post type?

in this way I throw a field for a custom record type into the
array array(
'label' => 'Description',
'desc' => '',
'id' => 'desc_product', // give an identifier.
'type' => ' textarea' // Specify the type of the field.
),
then run through foreach ($card_meta_fields as $field) {
then through switch($field['type']) {
and this is how I display the snake
case 'textarea':
echo ''.$ meta.'
'.$field['desc'].'';
break;
I need to display a simple visual editor instead of textarea, similar to this
413584d6a6d3476781f12ac811c5ce21.jpg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Ksenia Mikhailova, 2016-03-26
@arizona

You can connect supports, editor
wp-kama.ru/function/register_post_type#supports-array

R
Roman Savitsky, 2016-03-26
@PRC

412cebfc2efd48a5b6d70a631c3c8a5d.jpg

A
Alexander, 2016-03-26
@NeiroNx

You need to install the plugin https://ru.wordpress.org/plugins/tags/wysiwyg and already configure where it will be applied in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question