File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 1111 exit ;
1212}
1313
14- if ( ! function_exists ( 'media_handle_sideload ' ) ) {
15- require_once ABSPATH . 'wp-admin/includes/media.php ' ;
16- }
17- if ( ! function_exists ( 'download_url ' ) ) {
18- require_once ABSPATH . 'wp-admin/includes/file.php ' ;
19- }
20- if ( ! function_exists ( 'wp_read_image_metadata ' ) ) {
21- require_once ABSPATH . 'wp-admin/includes/image.php ' ;
22- }
23-
2414if ( ! class_exists ( 'Stackable_Design_Library ' ) ) {
2515 /**
2616 * Class Stackable Design Library
@@ -141,6 +131,16 @@ public function delete_cache() {
141131 }
142132
143133 public function get_design_library_image ( $ request ) {
134+ if ( ! function_exists ( 'media_handle_sideload ' ) ) {
135+ require_once ABSPATH . 'wp-admin/includes/media.php ' ;
136+ }
137+ if ( ! function_exists ( 'download_url ' ) ) {
138+ require_once ABSPATH . 'wp-admin/includes/file.php ' ;
139+ }
140+ if ( ! function_exists ( 'wp_read_image_metadata ' ) ) {
141+ require_once ABSPATH . 'wp-admin/includes/image.php ' ;
142+ }
143+
144144 $ url = $ request ->get_param ( 'image_url ' );
145145
146146 $ basename = sanitize_file_name ( wp_basename ( parse_url ( $ url , PHP_URL_PATH ) ) );
You can’t perform that action at this time.
0 commit comments