• Resolved Gabriel de Tassigny

    (@gdetassigny)


    I’m testing this plugin as it would be useful in our case, but unfortunately it doesn’t work as expected:

    • I’ve set it to “Replace the file, use the new file name, and update all links”
    • The attachment file is properly updated
    • The post content of posts that were using the previous image are NOT updated. They still point to the previous URL. This is happening in both classic editor and Divi builder.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Gabriel,

    That sounds like a caching issue, but just to be sure, have you taken a look at the following article??https://help.shortpixel.com/article/158-in-enable-media-replace-the-image-isnt-replaced-why

    Thread Starter Gabriel de Tassigny

    (@gdetassigny)

    Thanks for your response.

    After further investigation, this is related to the usage of object cache pro on our site. Adding an action to programmatically flush the cache when “emr/cache/flush” is triggered solved it.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Excellent, thanks for your input, Gabriel!

    Plugin Author Pedro

    (@petredobrescu)

    hello @gdetassigny,

    Thanks again for letting us know what was the solution. Can you also tell me what is the cache flush hook/action/function for the object cache pro? I’m thinking about adding this integration directly in our plugin, to avoid such issues for other customers as well.

    Thank you!

    Thread Starter Gabriel de Tassigny

    (@gdetassigny)

    Hi,

    I directly called:

    wp_cache_flush();

    and that seems to work fine.

    If you wanted to handle it using Object Cache Pro’s internal, you could do it this way too:

    	global $wp_object_cache;
    $wp_object_cache->flush();

    This implementation works, but it’s not ideal as it means the entire object cache is being flushed. Ideally I would prefer to be able to flush all related posts that got modified (I’m using the “Replace the file, use the new file name, and update all links” so I would need to call the clean_post_cache() function for each post that were modified). Is there a way to achieve this? I couldn’t find any hook within enable-media-replace plugin to be able to know which posts were modified

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Links in post not being replaced’ is closed to new replies.