We're merging with GenerateBlocks! Learn more here.

[Support request] Using shortcodes with multiple paramaters in editor

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Using shortcodes with multiple paramaters in editor

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20704
    Philip
    Participant

    I’m trying to add posts to a page with shortcode such as this:

    [wp_show_posts id="119" settings="post_id=452,126,456&orderby=post__in"]

    This works great, except that after you refresh the editor, the “&” character is replaced by the ampersand HTML code, at which point the “orderby” no longer works once you re-save. I’ve tried using various blocks – shortcode, HTML and text and they all have the same issue.

    Is there any way around this?

    #20719
    elvin
    Moderator

    Hi,

    This is WP editor’s default behavior. This is implemented as a security feature to prevent malicious scripts from executing.

    But you should be able to make the shortcode run by fixing the escaped ampersand and saving it immediately instead refreshing it and then saving w/o fixing the escaped ampersand.

    I understand that this is kinda tedious its a minor thing worth working with for the sake of safety.

    Alternatively, you can completely dodge this by adding the list on hooks through PHP filters if layout permits.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.