wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_load_image is deprecated since version 3.5.0!
Alternative: wp_get_image_editor()
Alternative: wp_get_image_editor()
wp_load_image › WordPress Function
Seit2.1.0
Veraltet3.5.0
› wp_load_image ( $file )
Parameter: |
|
Siehe: | |
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Load an image from a string, if PHP supports it.
Ähnliche Funktionen: wp_crop_image, wp_save_image, wp_preload_dialogs, media_upload_image, wp_stream_image
Quellcode
function wp_load_image( $file ) { _deprecated_function( __FUNCTION__, '3.5.0', 'wp_get_image_editor()' ); if ( is_numeric( $file ) ) $file = get_attached_file( $file ); if ( ! is_file( $file ) ) { /* translators: %s: File name. */ return sprintf( __( 'File “%s” does not exist?' ), $file ); } if ( ! function_exists('imagecreatefromstring') ) return __('The GD image library is not installed.'); // Set artificially high because GD uses uncompressed images in memory. wp_raise_memory_limit( 'image' ); $image = imagecreatefromstring( file_get_contents( $file ) ); if ( ! is_gd_image( $image ) ) { /* translators: %s: File name. */ return sprintf( __( 'File “%s” is not an image.' ), $file ); } return $image; }