Force default OG:Image – Yoast SEO [closed]

The action that allows an OG image to be added seemed to be the thing I was looking for, so much for proper documentation on their side. But now the only thing I’m wondering if the following code I made up is the proper way to deal with it:

$default_opengraph="https://www.rafaeldejongh.com/wp-content/uploads/2017/08/RafaelDeJongh-Web-Developer-3D-Artist.jpg";
function add_default_opengraph($object){global $default_opengraph; $object->add_image($default_opengraph);}
add_action('wpseo_add_opengraph_images','add_default_opengraph');
function default_opengraph(){global $default_opengraph; return $default_opengraph;}
add_filter('wpseo_twitter_image','default_opengraph');

As well as this one doesn’t add additional twitter:images but as far as I know there should also only be one for this.

But at least it’s a “solution” to my question rather than down voting this question, I would’ve loved to hear some feedback on it!