Working With Visual Composer VC_Single_Image

It’s not easy to trace trough the code behind [vc_single_image], because for start it uses the extract, that’s not recommended in WordPress or PHP in general.

The image attribute value is stripped for non-integers into the $img_id variable.

With your setup, there’s a call to wpb_getImageBySize( array( 'attach_id' => $img_id, ... ), that seems to be a wrapper that includes:

wp_get_attachment_image_src( $attach_id, 'large' );

So this image attribute is the image attachment ID (integer), just as Nathan Powell mentioned.

If we turn on the backend editor for the visual composer:

1

with the code you posted, then we should get this kind of view:

2

Click on the green pen and we should get the single image settings:

3

there it’s easy to select the image attachment directly from the media library.

If we don’t wan’t the visual setup, we can get the image attachment ID from various links in the Media library. For example when we edit an attachment, the url is:

/wp-admin/post.php?post=7004&action=edit

or when we view the attachment details, the url is:

/wp-admin/upload.php?item=7004

Hope it helps!