This topic has 7 replies, 3 voices, and was last updated 10 years by Mj.

  • Author
  • #31415
     Mj
    Participant

    Hi, I encountered that shortcodes are not allowed in the future item grid? How am I able to allow this?

    #31468
     sharmstr
    Moderator

    @abe: I’ve dug into this a bit and it appears the preg_match_all statement in kleo_grid.php is not finding any featured items that contain shortcodes. I suck at regular expressions so I haven’t tried fixing it yet. But you can see in the attached screenshot that ‘content’ contains two feature items, but the preg_match only finds one.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #31475
     sharmstr
    Moderator

    Okay. I think I got it working. I dont know how to use this is the child theme to make it upgrade safe, but probably wont be and issue if @abe makes it part of the core. Anyhow, as mentioned before, the issue was with the regular expression. To fix it

    – open /plugins/k-elements/shortcodes/templates/kleo_grid.php
    – comment out line 44 (verify this is the correct line!!)
    – add the new regular expression below it

    so this

    COPY CODE
    
    $sh = preg_match_all('~\[kleo_feature_item([^\[\]]*)]([^\[\]]+)\[/kleo_feature_item]~', $content, $childs);
    

    should be this

    COPY CODE
    
    //$sh = preg_match_all('~\[kleo_feature_item([^\[\]]*)]([^\[\]]+)\[/kleo_feature_item]~', $content, $childs);
    $sh = preg_match_all('~\[kleo_feature_item([\s\S]*)]\[/kleo_feature_item]~', $content, $childs);
    

    I havent tested all scenarios, but seems to be working without breaking other things. Again, I suck at regular expressions :/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #31483
     Abe
    Keymaster

    Hmm… interesting.. I will take a look and fix it. This will be included in next week update

    Thank you favorite user @sharmstr 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #31485
     sharmstr
    Moderator

    No problem. I’m sure you’ll test it because I didnt 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #31562
     Abe
    Keymaster

    I came with this code because I tested your suggestion and wasn’t matching if you didn’t had a shortcode inside

    COPY CODE
    
    $sh = preg_match_all('~\[kleo_feature_item([\s\S]*)]([^\[\]]*)\[/kleo_feature_item]~', $content, $childs);
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #31566
     sharmstr
    Moderator

    Hmmm. Yes it was. Look at my screenshot. But, that’s fine with me. Like I said, I suck at regexps. I always have 🙂 Just glad its fixed. Thanks!

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #31930
     Mj
    Participant

    Thanks for the fix!

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?