• Resolved Julie

    (@habannah)


    Hi Eliot,

    With the latest update, shortcodes within custom fields are no longer working… again. Lol. I’ve reverted to the previous version in the meantime, which fixed the problem.

    I see from the support forum that this update introduced a feature request — I’m really glad to see that the 4.2.3 hurdle was overcome so quickly that you are already back to adding new features! ??

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Well..just today I made 3~4 updates, to try to get shortcodes working correctly in all situations. It’s been quite extensive, and I’m afraid it’s not perfect yet. It should be improving with each update (hopefully!) so please let me know if the latest version solves this issue.

    Thread Starter Julie

    (@habannah)

    Thanks for getting back to me so quickly, Eliot. I updated to 2.6.1 and now, instead of seeing the actual shortcode on the front end, which was the problem earlier, I’m only seeing blank space…

    Plugin Author Eliot Akira

    (@miyarakira)

    Could you give me an example of the code that’s having the issue? I’ll try to narrow it down further.

    Hey Eliot,

    Don’t you forget to sleep sometimes! ??

    I think I have the same problem as Julie. After updating from 2.5.7 to 2.5.8 (yesterday) the shortcodes in my widgets don’t work correctly.

    In the widget I use this shortcode:

    [content type="template" name="sponsor-carousel-sidebar" field="html"]

    In the custom field “html” I have this shortcode:

    [loop type="sponsor" field="status_sponsor" value="actief" orderby="rand" fields="website_sponsor,title"]
    <li>
    <a href="{WEBSITE_SPONSOR}" target="_blank" title="{TITLE}">[field image="logo_sponsor" size="sponsor-logo-medium" image_class="aligncenter logo-sponsor-sidebar"]</a>
    </li>
    [/loop]

    In version 2.5.8 the output in the widget is the same as the shortcodes in the html-field.

    Since version 2.6.1 the output is “blank” and not only in widgets, also in pages/posts.

    Thread Starter Julie

    (@habannah)

    Thanks, Peter. Yes, exactly. All shortcodes which are stored in a custom field are currently outputting blank. With 2.5.8, they were outputting the actual shortcode rather than its intended content. This problem is affecting all shortcodes stored in custom fields, whether they are called from within the_content, a PHP template, another custom field… I don’t think providing an example would be useful because, as I said, it’s all codes within custom fields. I’m sure the codes are working. I think the problem is just that they don’t work from inside custom fields…

    And yes, now I’ve noticed, widgets are also being affected.

    2.5.7 is still the last version to work for me.

    Hey Eliot, Don’t you forget to sleep sometimes! ??

    Seconded! ?? Thanks for your help!

    Thread Starter Julie

    (@habannah)

    Hi again! I just tried out 2.6.3 and I’m still getting blank space where my shortcode content should be outputting… Though I did notice some improvement.

    I hadn’t realised this before, but with 2.5.7, using [taxonomy category term="id" field="link"] doesn’t output the title of the term with a link to its archive page. Instead, it outputs the url of the term with a link back to the archive page. With 2.6.3, the intended behaviour is back to normal — that is, the title of the term is outputted, not its url. NB: This isn’t related to the custom fields/widgets issue, as this code is placed directly in the_content.

    So I’m going back to 2.5.7 for now since I know those titles will display correctly once I’m back at the most recent version. I just need most of my content to display more than I need those titles at the moment…

    Thanks for keeping at this, Eliot!

    Does anyone know, why [field url] working in < a > tag, but does not worked in this code

    <tr onclick=”window.location.href = ‘<?php echo do_shortcode(‘[field url]‘); ?>'”>
    <td>[field title]</td>
    </tr>

    Does this problem associated to useing shortcode via javascript?

    @peter Berger can you halp me too?

    Thread Starter Julie

    (@habannah)

    Hi Eliot,

    I’ve noticed something else, but I don’t know whether this is new with 2.6.3 (I haven’t reverted to 2.5.7 yet, still checking things out…).

    I’m noticing that shortcodes placed within custom fields are working if the custom field is called from the same page. That is, placing [field field_name] within the_content works — the shortcode within the custom field outputs correctly.

    So it’s looking like the problem is only shortcodes placed within custom fields elsewhere than the current page, called using something like [content type="cpt" id="#" field="custom"]. I think this probably explains why widgets and PHP templates are being affected as well…

    I hope this helps you solve the issue! Cheers ??

    Plugin Author Eliot Akira

    (@miyarakira)

    Thanks, Julie, for the helpful info. I’ll test this use case and see what I can find. As you see, since the WP 4.2.3 update I’ve been making extensive changes throughout the plugin that affects all shortcode use cases. It’s a complex problem to solve, and I’m a bit overwhelmed with the number of support tickets. One difficulty is, if I cannot reproduce the issue on my end, it’s like working in the dark. So, any details to help me get a handle on an issue is greatly appreciated.

    @davidanielyan – From your code, it looks like you could change it to:

    <tr onclick="window.location.href='[field url]'">

    If the above doesn’t work, I included a new function do_ccs_shortcode for use in PHP, so you can try it to see if it helps.

    However, this is exactly what the WP 4.2.3 update was addressing, to remove the use of shortcodes inside HTML attributes. I’m doing my best to allow limited use of such cases, but it’s not easy – and, I still need to determine if that’s recommended, or if this plugin should also discourage/remove such use cases.

    Thread Starter Julie

    (@habannah)

    Thanks for the info, Eliot. I know you must be so busy right now, but you’re doing a good job keeping up with everything and trying to handle multiple problems at once in your updates. Hopefully all the support threads are pointing to the right area(s) to look at. I’m not surprised you can’t reproduce some of the issues I’m having — I’ll email you a sample in a text file, which will hopefully help you out.

    I still need to determine if that’s recommended, or if this plugin should also discourage/remove such use cases.

    FWIW, IMO, if it works with the new changes, and is allowed according to the new documentation, then it should be okay ?? If the documentation doesn’t address the issue, then perhaps ask the core team responsible for the API for guidance before removing functionality from the plugin. And also, perhaps give users notice and a timeline for updating their code before changing the functionality.

    @eliot Akira
    Thank you so much. But before I saw your message I had solved the problem using
    <tr onclick="window.location.href = '<?php echo '[field url]'; ?>'">

    With version 2.6.5 everything works as before.

    Thank you very much, Eliot. If you ever make this plugin premium, I’m the first buyer! ??

    Sorry, I didn’t check everything. Now the gallery field doesn’t work anymore…

    Thread Starter Julie

    (@habannah)

    Hi Eliot, everything that was causing issues before works for me, too.

    • Content from shortcodes stored in custom fields is now displaying correctly.
    • [taxonomy category term="id" field="link"] works again.
    • html in titles is working again.

    There’s only one custom field which stores a pass shortcode that’s not working, but it’s got another plugin’s shortcode that creates a link, so I’m still playing around with different options. I’ll get back to you if I need help with that…

    This issue is resolved for me. Thanks, Eliot! Didn’t end up sending you that text file since this update fixed everything for me… Cheers!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Shortcodes within Custom Fields No Longer Working’ is closed to new replies.