src/two/magictag.php
private function maybe_do_post_thumbnail( $field, $post ) {
		if ( 'post_thumbnail' == $field || false !== strpos( $field, 'post_thumbnail.' ) ) {
			$size = 'thumbnail';
			if ( false !== ( $pos = strpos( $field, '.' ) ) ) {
				$size = substr( $field, $pos + 1);
			}

			$id = get_post_thumbnail_id( $post->ID );
			if ( 0 < absint( $id ) ) {
				$img = wp_get_attachment_image_src( $id, $size);
				if ( is_array( $img ) ) {
					return $img[0];

				}

			}

			return 0;

		}

		return false;



	}
private function maybe_do_post_thumbnail( $field, $post ) {
		if ( 'post_thumbnail' == $field || false !== strpos( $field, 'post_thumbnail.' ) ) {
			$size = 'thumbnail';
			if ( false !== ( $pos = strpos( $field, '.' ) ) ) {
				$size = substr( $field, $pos + 1);
			}

			$id = get_post_thumbnail_id( $post->ID );
			if ( 0 < absint( $id ) ) {
				$img = wp_get_attachment_image_src( $id, $size);
				if ( is_array( $img ) ) {
					return $img[0];

				}

			}

			return 0;

		}

		return false;



	}
private function maybe_do_post_thumbnail ( $ field , $ post ) { if ( 'post_thumbnail' == $ field || false !== strpos ( $ field , 'post_thumbnail.' ) ) { $ size = 'thumbnail' ; if ( false !== ( $ pos = strpos ( $ field , '.' ) ) ) { $ size = substr ( $ field , $ pos + 1 ) ; } $ id = get_post_thumbnail_id ( $ post -> ID ) ; if ( 0 < absint ( $ id ) ) { $ img = wp_get_attachment_image_src ( $ id , $ size ) ; if ( is_array ( $ img ) ) { return $ img [ 0 ] ; } } return 0 ; } return false ; }
If field is "post_thumbnail" return image source URL

Supports .size traversal

@param string $field
@param \WP_Post|object $post Post object

@since 1.1.0

@return bool
If field is post_thumbnail return image source URL