process( $id, $width, $height ); if ( empty( $alt ) ) { $alt = get_post_meta( $id, '_wp_attachment_image_alt', true ); } $return_array = array( 'src' => $image[0], 'width' => $image[1], 'height' => $image[2], 'srcset' => $image[3], 'class' => $class, 'alt' => $alt, 'full' => $image[4], ); } elseif ( empty( $id ) && true == $placeholder ) { if ( empty( $height ) ) { $height = $width; } if ( empty( $width ) ) { $width = $height; } $return_array = array( 'src' => virtue_default_placeholder_image(), 'width' => $width, 'height' => $height, 'srcset' => '', 'class' => $class, 'alt' => $alt, 'full' => virtue_default_placeholder_image(), ); } else { $return_array = array( 'src' => '', 'width' => '', 'height' => '', 'srcset' => '', 'class' => '', 'alt' => '', 'full' => '', ); } return $return_array; } /** * Virtue get full image output. * * @param string $width the image width. * @param string $height the image height. * @param bool $crop if image is cropped. * @param string $class image class. * @param string $alt the image alt. * @param string $id the image id. * @param bool $placeholder whether to show a placeholder. * @param bool $lazy whether to use lazy. * @param bool $schema whether to show the schema output. * @param array $extra image attributes. */ function virtue_get_full_image_output( $width = null, $height = null, $crop = true, $class = null, $alt = null, $id = null, $placeholder = false, $lazy = false, $schema = true, $extra = null ) { $img = virtue_get_image_array( $width, $height, $crop, $class, $alt, $id, $placeholder ); if ( $lazy ) { if ( virtue_lazy_load_filter() ) { $image_src_output = 'src="data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=" data-lazy-src="' . esc_url( $img['src'] ) . '" '; } else { $image_src_output = 'src="' . esc_url( $img['src'] ) . '"'; } } else { $image_src_output = 'src="' . esc_url( $img['src'] ) . '"'; } $extras = ''; if ( is_array( $extra ) ) { foreach ( $extra as $key => $value ) { $extras .= esc_attr( $key ) . '="' . esc_attr( $value ) . '" '; } } else { $extras = $extra; } if ( ! empty( $img['src'] ) && true == $schema ) { $output = '
'; $output .= '' . esc_attr( $img['alt'] ) . ''; $output .= ''; $output .= ''; $output .= ''; $output .= '
'; return $output; } elseif ( ! empty( $img['src'] ) ) { return '' . esc_attr( $img['alt'] ) . ''; } else { return null; } }