Allow shortcodes in the product vendor description

With WooCommerce Product Vendors you can allow other people to sell their products in your store.

You will probably want to create a custom page for each of them, and this is automatically done by the extension because vendors are taxonomies.

They have a description, a title, and some other options. But the description does not allow to add shortcodes.

Shortcodes are something that helps a lot in the website development and make things a lot quicker.

How to allow to add shortcodes in the product vendor description?

Open your functions.php file located in wp-content/themes/your-theme-name/ and add this code at the end of the file:

This code is really easy to understand, it passes the variable $desc (the description text) to the WordPress function do_shortcode which executes all the shortcodes contained in it, then returns the executed contents to the plugin which prints it on the page.


More Posts That You Might Like…


5 responses to “Allow shortcodes in the product vendor description”

  1. Hello

    I just want to thank you for the codes. They worked like a charm.
    Shortcodes in the description worked , however they are filtering out all the headings.

    For example:
    [ux_banner bg=”#000″ height=”350px”]

    Sale

    [/ux_banner]

    They would turn out without the

    So the words “Sale” can’t be resized.
    Is there anyway to allow add_filter headings?

    Your help is greatly appreciated.
    Thank you in advance

    Yours sincerely
    Reeve

    1. Hi Reeve, i’m not sure to understand what you mean. Are you adding shortcodes in the vendor name?

  2. Hi,
    Should a similar code work for woocommerce market place wcmp. I recently downloaded the woo commerce product table plugin but wish to use it on my vendor pages however wcmp does not create editable pages for its vendors.

  3. Apologies, more details. The reason I ask about entering the shortcode is that the woocommerce product table plugin seems to only allow me to add the shortcode to pages and does not allow the feature to be gobally activated.

    Thanks,

    1. Hi Kevin,
      I’m sorry but I don’t know the plugins you are talking about, I don’t know how/if it will work.

Leave a Reply

Categories

Newsletter

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Blog at WordPress.com.

%d bloggers like this: