24 posts
    Has referred 1+ members Has sold $40,000+ on Envato Market Has collected 100+ items on Envato Market Won a Most Wanted contest
+3 more
bonsaished says

Hi Everyone!

I’ve recently posted a theme which was soft rejected for having a shortcode cleanup code in it: http://cl.ly/image/3b17402C3g1a

The reviewer stated that “This is a poor practice and we’re encouraging authors to use another methods rather than stripping out or modifying native WordPress functionalities.”.

I actually don’t necessarily disagree with him/her. This is not the best practice in the World, but it gets around a WordPress problem where empty paragraph tags are generated, especially for nested shortcodes.

I was wondering if anyone has any better methods to do this. Strictly speaking this method does not violate WordPress “ethics” as it uses hooks to do what it does. On the other hand it DOES modify user submitted content which may or may not be good.

I would appreciate any help on this!

Daniel

280 posts
    Has referred 10+ members Has sold $40,000+ on Envato Market Has collected 10+ items on Envato Market Sells items exclusively on Envato Market
+1 more
PrimaThemes says

The key message is you cannot apply that function to all shortcodes (and all post contents), because only few shortcodes need that…

For example, based on your code:

Line 605 and 606 can be applied to [column] shortcode to clean the shortcode output from unproper <p> tag from wpautop function.

BUT, line 607,608,609 replaces any line break or empty paragraph to be a space and it is not acceptable.

24 posts
    Has referred 1+ members Has sold $40,000+ on Envato Market Has collected 100+ items on Envato Market Won a Most Wanted contest
+3 more
bonsaished says

Hello there :)

I can see who’s reviewing my theme now :) What in the World os going on with the theme submitter?

I stil disagree with some of this. The main reason I have is that we’ve submitted 4 themes with a different company. All of them have the same code in it. We’re well above 1.000 sales for these themes and this problem has never come up.

I do see where the problem, but I think in 99% of the cases this will not cause issues. Most line breaks are converted by wpautp which is applied automatically. I think any time the user wants to move content using the line breaks we can use better things, like a ‘[section]’ shortcode or something. Also, empty p tags are not great code so isn’t it better to remove them?

Daniel

280 posts
    Has referred 10+ members Has sold $40,000+ on Envato Market Has collected 10+ items on Envato Market Sells items exclusively on Envato Market
+1 more
PrimaThemes says

Hi Daniel,

Different theme marketplace have different theme reviewer, and of course, different code standard. :-)

For this case, TF theme reviewer said, “This is a poor practice and we’re encouraging authors to use another methods rather than stripping out or modifying native WordPress functionalities.” And personally I agree with the bold statement above.

You ask help on this forum, and I give my comment. If you think that you have valid argument on this issue, then you can try to submit your theme again and add some notes for the theme reviewer. Usually you will get additional & detail feedback from the theme reviewer (if they are in a good mod of course)... ;-)

24 posts
    Has referred 1+ members Has sold $40,000+ on Envato Market Has collected 100+ items on Envato Market Won a Most Wanted contest
+3 more
bonsaished says

Hello :)

I have resubmitted it, I removed the code right away. The fact that I disagree does not mean I am right, I think reviewers see WAY more themes than I do, so I defer to their judgement. i’d rather discuss it afterwards as I think a discussion is a good way to change something that is wrong, however, I assume reviewers know more about what is good for the marketplace and buyers than I do :)

I disagree about the bold statement as well. Hooks are specifically for stripping out or modifying WordPress functionality. On the wpautop Codex Page it specifically says that some authors choose to disable wpautop. Since the Codex does not raise any issues I assume they are ok with this.

Stripping out and modifying native functions is what hooks are for. I think the problem is if you use hooks in ways which are unpredictable, unnecessary or cause surprising behaviour for the user. In this case this snippet stops unpredictable things from happening. We developed it specifically to remedy problems users were having a while back with unpredictable spacings in their posts when using specific shortcodes.

I still defer to the judgement of the reviewers. I understand that managing a marketplace is not easy and it is better to ensure uniform quality then let people do whatever they want :)

Also, I thought you were the one reviewing the theme :)

Daniel

280 posts
    Has referred 10+ members Has sold $40,000+ on Envato Market Has collected 10+ items on Envato Market Sells items exclusively on Envato Market
+1 more
PrimaThemes says

Also, I thought you were the one reviewing the theme :)

Hi Daniel,

I am not TF theme reviewer. ;)

Back to 2012, some theme authors simply remove wpautop filter to avoid this shortcode output issue. Then, this solution bring many issues to end user. Then, it is not allowed here.

I also developed similar function to solve this shortcode output issue for my previous themes on TF, and it was accepted. But yes, I do not remove line break or empty paragraph on my function. And I apply that function to specific shortcodes.

Good luck with your theme.

24 posts
    Has referred 1+ members Has sold $40,000+ on Envato Market Has collected 100+ items on Envato Market Won a Most Wanted contest
+3 more
bonsaished says

I agree about removing wpautop completely :) I will readd the function in an update as you suggested, without the removal of line breaks or empty p tags :)

Thank you :) There is a demo if you are interested :)

Daniel

808 posts We're a nice team!
    Elite Author: Sold more than $75,000 on Envato Market Sells items exclusively on Envato Market Made it to the Authors' Hall of Fame Has sold $125,000+ on Envato Market
+9 more
ThemeFocus says

Hello there :)

I can see who’s reviewing my theme now :) What in the World os going on with the theme submitter?

I stil disagree with some of this. The main reason I have is that we’ve submitted 4 themes with a different company. All of them have the same code in it. We’re well above 1.000 sales for these themes and this problem has never come up.

I do see where the problem, but I think in 99% of the cases this will not cause issues. Most line breaks are converted by wpautp which is applied automatically. I think any time the user wants to move content using the line breaks we can use better things, like a ‘[section]’ shortcode or something. Also, empty p tags are not great code so isn’t it better to remove them?

Daniel

Now , you change it to what and submit it?

24 posts
    Has referred 1+ members Has sold $40,000+ on Envato Market Has collected 100+ items on Envato Market Won a Most Wanted contest
+3 more
bonsaished says

Hi activetofocus,

I did as the reviewer requested immediately. He told me which parts to remove and I did so. As I said, I do not agree, but I defered to his judgement, he has more experience than I do with reviewing themes :)

808 posts We're a nice team!
    Elite Author: Sold more than $75,000 on Envato Market Sells items exclusively on Envato Market Made it to the Authors' Hall of Fame Has sold $125,000+ on Envato Market
+9 more
ThemeFocus says

Hi activetofocus, I did as the reviewer requested immediately. He told me which parts to remove and I did so. As I said, I do not agree, but I defered to his judgement, he has more experience than I do with reviewing themes :)

You delete your shortcode cleanup code function? That’ll not works fine for shortcode as I think.

by
by
by
by
by
by