• heyjoecampbell

    (@heyjoecampbell)


    Please provide a code snippet to remove the query string added to each URL.

    Consider adding a setting to disable the feature as some users do like plugins modifying urls.

    Thanks ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Aspen Grove Studios Support

    (@aspengrovesupport)

    Hello,
    Thanks for contacting us.
    Can you provide information on which query string you are referring to?

    Thread Starter heyjoecampbell

    (@heyjoecampbell)

    The query string is appended to the images in the Media Library, here is a sample:

    ?_t=1722894832
    ?_t=1722894964

    Plugin Author WP Zone

    (@aspengrovestudios)

    Hi, this query parameter is added by default in the admin to help prevent caching from causing issues when an image is changed – without it, the image may not switch to the new image for some time after the image is replaced.

    It can be removed via the following (we’d suggest in the?admin_init?hook since only the admin should be affected by these hooks):

    remove_filter('wp_calculate_image_srcset', 'hm_replace_image_calculate_image_srcset');

    remove_filter('wp_get_attachment_image_src', 'hm_replace_image_get_attachment_image_src');

    remove_filter('wp_prepare_attachment_for_js', 'hm_replace_image_prepare_attachment_for_js');

    Is there a reason why you want to remove the query parameter? Is it causing problems?

    Thread Starter heyjoecampbell

    (@heyjoecampbell)

    I sometime copy the image url from the Media Library for frontend usage.

    Thread Starter heyjoecampbell

    (@heyjoecampbell)

    Thanks for providing the filters ????

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