Closed DevWael closed 3 years ago
Hello @DevWael,
Thanks for the feedback and the pull request! However, I cannot accept it since it will change the Image field type to text, and break compatibility with all other users which already use Image Upload.
FYI, you can already use an Image URL using the following hooks available in the plugin's FAQ:
// add_filter('acfe/flexible/thumbnail/name=my_flexible', 'acf_flexible_layout_thumbnail', 10, 3);
// add_filter('acfe/flexible/thumbnail/key=field_xxxxxx', 'acf_flexible_layout_thumbnail', 10, 3);
// add_filter('acfe/flexible/thumbnail/name=my_flexible&layout=my_layout', 'acf_flexible_layout_thumbnail', 10, 3);
// add_filter('acfe/flexible/thumbnail/key=field_xxxxxx&layout=my_layout', 'acf_flexible_layout_thumbnail', 10, 3);
add_filter('acfe/flexible/thumbnail/layout=my_layout', 'acf_flexible_layout_thumbnail', 10, 3);
function acf_flexible_layout_thumbnail($thumbnail, $field, $layout){
// Must return an URL or Attachment ID
return 'https://www.example.com/my-image.jpg';
}
Have a nice day!
Regards.
:memo: Description
The flexible field became an awesome field after the ACF-Extended plugin but when it comes to creating a theme and making a theme home page builder using this field type, you will need to host the assets of the sections you have created with the flexible content field. then we need to have the option to set the URL of the image instead of uploading it to the website.
:gem: Type of change