Error when using define( ‘MICROSOFT_AZURE_CNAME’,”) within theme
-
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
srcsetattributes were not linking to my custom CNAME but instead to “.blob.core.windows.net” (which obviously was not resolving) despite this attribute being set usingdefinewithin my themefunctions.php.Further digging got me to the
windows_azure_storage_wp_calculate_image_srcsetfunction where I was able to track down the issue, that being the use ofWindowsAzureStorageUtil::get_storage_url_base( false )when setting$base_url.After some more time I realized the
MICROSOFT_AZURE_CNAMEdefined constant was not available within that function, which led me to add it intowp-config.phpand 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 vswp-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
imgsrcattribute was set correctly.Thanks.
Mike
The topic ‘Error when using define( ‘MICROSOFT_AZURE_CNAME’,”) within theme’ is closed to new replies.