• Resolved yourfluf

    (@yourfluf)


    Hi – thanks for this plugin super useful.

    The get_the_guid() docs say: “The guid will appear to be a link, but should not be used as an link to the post. The reason you should not use it as a link, is because of moving the blog across domains.

    Well.. I migrated sites and this has happened to me and that function now outputs urls of my product images (for which i have attachments) of example.com/?attachment_id=x – rather than example.com/wp-content/uploads/2024/01/x.jpg.

    I solved this by replacing $url = $att_id ? get_the_guid($att_id) : null; in fifu_get_full_image_url() with $url = $att_id ? wp_get_attachment_image_src($att_id, 'full')[0] : null;. It seems to work for me, but would appreciate your perspective on this situation? Especially as my fix will be overwritten by the next update.

    This product by the way doesn’t have any fifu images / postmetas, so i’m surprised I’m even making this fix. But this question is more about the first issue.

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marcel

    (@marceljm)

    Hi, @yourfluf.

    The get_the_guid() docs say: “The guid will appear to be a link, but should not be used as an link to the post. The reason you should not use it as a link, is because of moving the blog across domains.

    That’s not applicable to the remote images managed by FIFU, because the plugin works with full URLs.

    Well.. I migrated sites and this has happened to me and that function now outputs urls of my product images (for which i have attachments) of?example.com/?attachment_id=x?– rather than?example.com/wp-content/uploads/2024/01/x.jpg.

    You are talking about local images. So sorry, I don’t understand how that’s related with the plugin. Please access FIFU > Status. Copy and send me that.

    Thread Starter yourfluf

    (@yourfluf)

    Hi @marceljm,

    Sorry I made a slight mistake in my original message, i meant to say wp_get_attachment_url($att_id) not wp_get_attachment_image_src($att_id, "full")[0].

    So I’m not sure because if you look at this post on my site. I can confirm that there are no fifu images here (judging from my postmeta table). However it still loads the fifu elements like lslide. I’ve changed my site back to the default (e.g. using get_the_guid()) just to illustrate how it results in no images (unlike the wp_get_attachment_url() solution.

    Thanks Marcel, have sent over the status logs to the fifu support email.

    Plugin Author Marcel

    (@marceljm)

    Hello, @yourfluf.

    A new version was released to solve that.

    Thread Starter yourfluf

    (@yourfluf)

    Cool thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Avoid get_the_guid() in fifu_get_full_image_url()’ is closed to new replies.