• Resolved jqz

    (@jqz)


    I am not sure how, as I’ve looked at the code in shortcodes.php and can’t see how they could be creeping in.

    I’ve eliminated and processed the unwanted P elements as indicated at https://wordpress.stackexchange.com/questions/49077/shortcode-from-a-widget-is-wrapped-in-unwanted-p-element/

    But I am finding the content of the shortcode is often immediately prefixed by </p> and immdediately postfixed by <p>, which end up being unmatched tags and cause undesirable results.

    What code is adding these tags, and how should I disable it?

    Note1: If I do not follow the suggestions from the link above, there are still unmatched P tags, and the result is generally worse.

    Note2: I am using nested shortcodes.

Viewing 1 replies (of 1 total)
  • Thread Starter jqz

    (@jqz)

    The culprit seems to be shortcode_unautop which is leaving the content with mismatched <p> tags, causing further processing to go awry. Removing it helps:
    remove_filter('the_content', 'shortcode_unautop');

Viewing 1 replies (of 1 total)
  • The topic ‘Bad P elements added by shortcode processor??’ is closed to new replies.