• Hi,

    Firstly, I will start by saying – excellent plugin! Invaluable for my sites.

    I have recently installed this plugin on a multi site instance with a custom theme including pre defined Azure storage options within the theme.

    All good and working fine, however when trying to view images on the front end they were not loading.

    Upon further investigation I noted images srcset attributes were not linking to my custom CNAME but instead to “.blob.core.windows.net” (which obviously was not resolving) despite this attribute being set using define within my theme functions.php.

    Further digging got me to the windows_azure_storage_wp_calculate_image_srcset function where I was able to track down the issue, that being the use of WindowsAzureStorageUtil::get_storage_url_base( false ) when setting $base_url.

    After some more time I realized the MICROSOFT_AZURE_CNAME defined constant was not available within that function, which led me to add it into wp-config.php and voila – it worked!

    I am guessing this “issue” is caused by namespaces for defined constants in WordPress themes?

    Can any modifications be made to support using define( 'MICROSOFT_AZURE_CNAME','') within the theme files vs wp-config.php?

    Should be noted all other functionality worked perfectly with it defined in the theme, e.g CNAME showed correctly in WP admin and the img src attribute was set correctly.

    Thanks.

    Mike

  • The topic ‘Error when using define( ‘MICROSOFT_AZURE_CNAME’,”) within theme’ is closed to new replies.