Open carlituxman opened 1 year ago
I just trying moving uploads folder from existing wordpress to azure storage. But _wp_attached_file posts has a relative path, then wp attach site url
Then you can force moved previous uploads:
Now:
function windows_azure_storage_wp_get_attachment_url( $url, $post_id ) { $media_info = get_post_meta( $post_id, 'windows_azure_storage_info', true ); if ( ! empty( $media_info ) && isset( $media_info['url'] ) ) { return $media_info['url']; } else { return $url; } }
No response
function windows_azure_storage_wp_get_attachment_url( $url, $post_id ) { $media_info = get_post_meta( $post_id, 'windows_azure_storage_info', true ); if ( ! empty( $media_info ) && isset( $media_info['url'] ) ) { return $media_info['url']; } else { // **_---> RETURN base_url from AZURE with moved image_** if(defined('AZURE_STORAGE_URL')) { $upload_file_name = get_post_meta( $post_id, '_wp_attached_file', true ); return AZURE_STORAGE_URL . $upload_file_name; } else { return $url; } } }
Is your enhancement related to a problem? Please describe.
I just trying moving uploads folder from existing wordpress to azure storage. But _wp_attached_file posts has a relative path, then wp attach site url
Then you can force moved previous uploads:
Now:
Designs
No response
Describe alternatives you've considered
Code of Conduct