• Resolved edel242

    (@edel242)


    Hi Alberto de Vera Sevilla,
    Nice plugin!
    I would like to insert shortcodes into the brand description.
    Can you do that to me – how expensive?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor titodevera

    (@titodevera)

    Hi edel242!

    Simply install a plugin like this: Visual Term Description Editor and use your shortcodes into the brand description.

    😉

    Thread Starter edel242

    (@edel242)

    thanks for the information. Its not run for me: https://samary.ch/brand/badefee

    Thread Starter edel242

    (@edel242)

    maybe in funktion.php
    add_filter( '???', 'do_shortcode' );

    The effective part of Visual Term Description Editor in this case is the following line.
    add_filter( 'term_description', 'do_shortcode' );

    This filter does not work however because it is never being applied.
    I fixed the issue myself for my installation by editing the following lines:

    In /classes/class-perfect-woocommerce-brands.php
    line 917: echo do_shortcode($queried_object->description);

    In /classes/class-pwb-product-tab.php
    line 45: <?php if( !empty($brand->description) ) echo '<div>'.do_shortcode($brand->description).'</div>';?>

    However, this only lasts until the plug-in gets updated.
    A more permanent solution would be:

    In /classes/class-perfect-woocommerce-brands.php
    line 917: echo apply_filters('pwb-brand_description',$queried_object->description);

    In /classes/class-pwb-product-tab.php
    line 45: <?php if( !empty($brand->description) ) echo '<div>'. apply_filters('pwb-brand_description',$brand->description).'</div>';?>

    In functions.php

    /* Allow shortcodes in brand pages */
    add_filter( 'pwb-brand_description', 'do_shortcode' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode in Description’ is closed to new replies.