• Resolved petroglyphic

    (@petroglyphic)


    The plugin is causing unwanted <p> and <br> tags to be added inside shortcode output. If I disable the plugin the tags and resulting spaces go away. I don’t think it’s a result of a conflict with my theme – there’s nothing containing “wpautop” in any of the theme function files.

    I saw in the changelog several mentions of adjusting the processing order for shortcodes and wpautop, which was the clue that the plugin is the culprit. I hope you can fix this, I like your plugin!

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter petroglyphic

    (@petroglyphic)

    I realized – I had checked “Move post content formatting (wp_autop) to after shortcodes” per your instructions, because I have loops running and I get an empty <p></p> after each item in the loop:
    <ul>[loop type="page" id="26147"][attached orderby="title"]<li><a href="[field url]" target="_blank">[field title]</a></li>[/attached][/loop]</ul>

    I can’t use the move wpautop option, since it trashes the layout in the directory listings and parts of Gravity Forms (and probably other places I hadn’t looked). Is there a way I can assign that option in the shortcode attributes so it’s confined to those calls? Or format the loop so it doesn’t generate the breaks? Removing all the line breaks in the loop doesn’t fix the problem.

    Plugin Author Eliot Akira

    (@miyarakira)

    There is a parameter for removing <p> and <br> tags inside the loop:

    [loop type="page" clean="true"]

    I hope this will solve the empty <p></p> added by wpautop.

    It’s too bad that “move wpautop” option didn’t work. The issue of auto-formatting keeps coming up, and “move wpautop” seemed to solve it for some people. It works by changing the priority of wpautop to after shortcode processing. However, this changes default behavior, and I see from your description that it can cause unwanted results with some theme or plugins.

    There’s a script called “shortcode unautop” that I recently found. I’ll try how it works, and add it as an option in the next update.

    Thread Starter petroglyphic

    (@petroglyphic)

    clean=”true” works IF there are no line breaks between [loop] & [/loop]. You might want to include this in the documentation.

    Plugin Author Eliot Akira

    (@miyarakira)

    As you may know, I’ve struggled to eliminate this auto-formatting issue. The next plugin update will include the [raw] shortcode solution, which hopefully to resolve this finally.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘shortcodes & wpautop’ is closed to new replies.