Public Ticket #1493553
Shortcode properties do not display correctly, they are truncated


  • niceappsfr started the conversation


    I use the latest version of WordPress 4.9.4 and PHP 7.0.

    When displaying an article, the properties of the shortcodes do not display correctly, they are truncated: only the first word of the property is displayed preceded by a double quote.

    For example, when I use the carousel shortcode, and as soon as a property contains spaces characters (title, description, etc.) the text is truncated on the display (only the first word appears).

    Here is the code I copied from your demo:

    [carousel arrows = "display" buttons = "display" caption = "display" interval = "3"]
    [panel title = "Optional Slide Title" description = "This slide has a description"]  city5 [/ panel]
    [/ Carousel]

    In this example, the title should be Optional Slide Title, but the text "Optional is displayed instead.

    I feel that this is happening everywhere, including on your own demo site at http://www.industrialthemes.com/explicit/shortcodes-typography/

    One solution is to replace all spaces with & nbsp; but each time we edit the article, they are replaced by space characters by WP ...

    How can I fix the problem?

    With thanks,

    Attached files:  Capture d’écran 2018-03-06 à 19.08.55.png

  •  312
    Brian replied

    Try editing functions/core.php line 415:

    $content = preg_replace('#^<\/p>|^<br \/>|<p>$#', '', $content);

    Try commenting it out like so:

    //$content = preg_replace('#^<\/p>|^<br \/>|<p>$#', '', $content);

  • niceappsfr replied


    Thank you for the answer.