• Hi

    I am using cloudfront and interested in asset pull.

    If I manage to set the assets.mydomain.com with asset pull addon.
    is there a way to set specific javascript files are not loaded from assets.mydomain.com? (intead, i wish to make it load from mydomain.com for that file)?

    I could not find any doc talking about it.
    However, I saw some snippets are avaialble for s3 media like below but have not seen for asset pull tho.
    https://wordpress.org/support/topic/how-to-stop-offloading-specific-file-type-to-s3/

    Mind sharing some insights or sample snippet?

    Thank you

    • This topic was modified 1 year, 4 months ago by futureyoon.
    • This topic was modified 1 year, 4 months ago by futureyoon.
    • This topic was modified 1 year, 4 months ago by futureyoon.
    • This topic was modified 1 year, 4 months ago by futureyoon.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Delicious Brains

    (@deliciousbrains)

    Hi @futureyoon,

    When testing whether an asset should be rewritten or not, we run the following filter that you could hook into…

    
    /**
     * @param bool        $rewrite Should the src be rewritten?
     * @param string      $src     The asset URL to be rewritten.
     * @param string|null $handle  The asset's registered handle in the WordPress enqueue system.
     */
    return apply_filters( 'as3cf_assets_should_rewrite_src', $rewrite, $src, $handle );

    -IJ

    Thread Starter futureyoon

    (@futureyoon)

    Hi IJ,

    Thank you for the quick response.
    I guess the following with my limitted knowledge.

    $rewrite : I guess this is current path i wanto to rewrite
    $src : this is the path i want it to be
    $handle : what option do we have for this?

    what do we put for handle? any avaiable options for that, or just null only?

    Thank you

    Thread Starter futureyoon

    (@futureyoon)

    Hmmm…

    I dont think I can understand how this works, anyway..

    I just wish to change the url for particular files under a folder.

    mydomain.com/wp-content/plugins/abcdef/*.* to be loaded from mydomain.com instead of assest.mydomain.com

    would you be kind enough to write some simple code for me?

    sorry and thank you.

    • This reply was modified 1 year, 4 months ago by futureyoon.
    • This reply was modified 1 year, 4 months ago by futureyoon.
    Plugin Author Delicious Brains

    (@deliciousbrains)

    Hey @futureyoon,

    As you’re working with a feature only available in WP Offload Media, please contact support via the “Support” tab of the plugin and someone will help you out.

    For best results, please link to this topic to give the support person some context.

    -IJ

    Thread Starter futureyoon

    (@futureyoon)

    Hi

    sorry for late response.
    Just wondering if this can be done via snippet code? or need to modify the original code?

    I just wish to set the direction right. Please kindly advise.

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘asset pull opt out for specific files’ is closed to new replies.