I am trying to hook a function to wp_head that adds some meta tags, but I does not work correctly. Here is my code:
add_action( 'wp_head', 'add_meta_tags' , 2, 1 );
do_action('add_meta_tags',$pick_data);
function add_meta_tags($pick_data) {
$h=$pick_data[0]->h_team;
$a=$pick_data[0]->a_team;
echo '<meta property="og:title" content="'.$h.' vs '.$a.'" />' . "\n";
}
The function is executed, but the parameter ($pick_data) is not passed. So I am getting in my head:
<meta property="og:title" content=" vs " />
What am i doing wrong?