Can't get image_advanced alt in nested group

Support MB Group Can't get image_advanced alt in nested group

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15250
    sergeysemenovsergeysemenov
    Participant
    $object_imgs = isset( $object['dekor_image'] ) ? $object['dekor_image'] : array();
    if ( ! empty( $object_imgs ) ) {
        foreach ( $object_imgs as $object_img ) {
            echo '<a href="'. wp_get_attachment_image_url( $object_img, 'type=image_advanced&size=full&multiple=true' ) .'" rel="fancybox"><img src="' . wp_get_attachment_image_url( $object_img, 'type=image_advanced&size=full&multiple=true' ) . '" alt="' . RWMB_Image_Field::file_info( $object_img ) . '" /></a>';
        }
    }

    Only get Array in fancybox

    #15251
    sergeysemenovsergeysemenov
    Participant

    Get an Array in fancybox

    #15253
    Anh TranAnh Tran
    Keymaster

    Hi, please change the code to:

    $object_imgs = isset( $object['dekor_image'] ) ? $object['dekor_image'] : array();
    if ( ! empty( $object_imgs ) ) {
        foreach ( $object_imgs as $object_img ) {
            $image = RWMB_Image_Field::file_info( $object_img );
            echo '<a href="'. $image['full_url'] . '" rel="fancybox"><img src="' . $image['full_url'] . '" alt="' . $image['alt'] . '" /></a>';
        }
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.