Disabling Shortcodes

This topic contains 9 reply and 3 voices, and was last updated by Sekander Badsha 9 years, 11 months ago
Viewing 9 Posts - 1 through 9 (of 9 total)
Author Posts
November 13, 2014 at 4:38 pm 30392
Sekander Badsha Hello devs. The_content and the description fields of a product in the dashboard let users insert html, shortcodes and all kind of stuff. This could be a problem, is there a way to change this behaviour?
November 13, 2014 at 4:55 pm 30398
Roberto Roberto

Plus, there is no way of having an edited product moved to “pending” automatically, so If i approve a product and then the seller changes the content adding shortcodes or html tag that screw up the page, how can i prevent this?

Am i doing something wrong?

November 13, 2014 at 5:57 pm 30408
Nayem Nayem

Hello Roberto,

Im cheking your issue. Please allow me some time. I will be back to you with a right solution.

Thank you 🙂

November 13, 2014 at 7:17 pm 30415
Nayem Nayem

Hello Roberto,

I checked your issue but failed to reproduce the issue. Can you please provide a screenshot?.

November 13, 2014 at 7:27 pm 30416
Roberto Roberto

I am using a theme called Jupiter.
It allows a lot of custom shortcodes, like this

[mk_chart percent=”50″ bar_color=”#00c8d7″ track_color=”#ececec” line_width=”10″ bar_size=”150″ content_type=”percent” icon=”moon-alarm-2″]

which builds a fancy chart.

If i enter this or other custom shortcodes, they actually appear on the frontend.
I Believe dokan should be blocking all the shortcodes, as default behaviour, in order not to give too much “power” to the sellers.

On the other hand, the textarea named “post_excerpt” does not parse the html. Meaning if i write “Hey” and click “update product”, the layout of the product page screws up.

I’ll post some screens asap.
Cheers

November 20, 2014 at 5:28 pm 30861
Sekander Badsha Sekander Badsha

Hello Roberto,

Shortcode is a feature that works on anywhere in the wordpress system, regardless the input area file or place. So there is no way to stop it from frontend or depending on user roles.

November 20, 2014 at 11:25 pm 30878
Roberto Roberto

QUestion: is this

remove_filter('the_content', 'do_shortcode', 11);

something that may work? Just asking cuz im not an expert.
Cheers

November 30, 2014 at 4:00 pm 31429
Sekander Badsha Sekander Badsha

Hello Roberto,

Disabling the shortcodes is possible. But as I said earlier, it will turnoff the shortcodes globally. So the shorcodes in your site will not work any where in your website. Shotcodes can not be bound to one single page.

Thank you for understanding. 🙂

December 2, 2014 at 2:55 pm 31599
Roberto Roberto

WordPress: Disable All Shortcodes from the_content

Here they say it’s possible somehow. Would this code work with some editing or do you think it won’t?

Thank you for your help!!!

December 11, 2014 at 1:18 pm 32137
Sekander Badsha Sekander Badsha

Hello Roberto,

We have not tried such type of codes. You may give it a try in your local/testing/staging server and see if that works or not 🙂

Viewing 9 Posts - 1 through 9 (of 9 total)