Undefined variable notice [closed]

You are getting that because the $post variable isn’t set.
You’ll need to call global $post at the beginning of your function.

function custom_content_filter_the_content( $content ) {
    global $post;
    ...