IF Inside A Function For Content Filter [closed]

This should be it –

<?php function my_the_content_filter( $content )
{
    if( get_post_meta( get_the_ID(), "heading_image", true) )
    {
        $image_id = get_post_meta( get_the_ID(), "heading_image", true);
        $post_image_data = wp_get_attachment_image_src( $image_id, 'full' ); ?>

        // checks if you have got the source
        if( isset($post_image_data[0]) )
        {
            // if image is show before the content
            $content="<img src="". $post_image_data[0] .'" style="max-width:1000px;" />' . $content;
        }
    }

    return $content;
}
add_filter( 'the_content', 'my_the_content_filter' ); ?>

tech