Thanks, this solves the problem.
add_filter( 'wpseo_opengraph_title', function($title){
global $post;
$meta = get_post_meta($post->ID, '_yoast_wpseo_opengraph-title', true);
// use post title only if og:title is not set
if( empty($meta) && !empty($post->post_title) ){
$title = $post->post_title;
}
return $title;
});
Than you for your reply.
I need more than that. I need two different templates: for document title, it should be:
%%title%% %%sep%% %%sitename%% and for og:title it should be just %%title%%. If I change it from settings to %%title%%, it will be same in both. If there is a filter for changing document title, then this approach could be viable.