D
D
DimDim77782019-10-21 23:23:14
WordPress
DimDim7778, 2019-10-21 23:23:14

How to allow code in woocommerce product short description?

Hello.
There is such a code that displays a short and complete description of the product. If you add, for example, a video code to a short description, then after the publication the code structure is lost and only text is displayed, and if you add it to the full description, then everything is displayed correctly. Tell me how to allow the code to be inserted into the short description so that it does not change after saving.

<div class="dokan-product-short-description">
                                <label for="post_excerpt" class="form-label"><?php esc_html_e( 'Short Description', 'dokan-lite' ); ?></label>
                                <?php wp_editor( $post_excerpt , 'post_excerpt', apply_filters( 'dokan_product_short_description', array( 'editor_height' => 50, 'quicktags' => false, 'media_buttons' => false, 'teeny' => true, 'editor_class' => 'post_excerpt' ) ) ); ?>
                            </div>

                            <div class="dokan-product-description">
                                <label for="post_content" class="form-label"><?php esc_html_e( 'Description', 'dokan-lite' ); ?></label>
                                <?php wp_editor( $post_content , 'post_content', apply_filters( 'dokan_product_description', array( 'editor_height' => 50, 'quicktags' => false, 'media_buttons' => false, 'teeny' => true, 'editor_class' => 'post_content' ) ) ); ?>
                            </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DimDim7778, 2019-10-21
@DimDim7778

To allow html in product categories, there is the following code:

remove_filter('pre_term_description', 'wp_filter_kses');
remove_filter('pre_term_description', 'wp_kses_data');

But how can this be applied to a brief description of the product?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question