I have a function in the function.php file that, when clicked, displays the publications and publishes them automatically. I had to make the publications private because of their content. Do you know how I can do so that they only see with the link? or for a certain time? My publications are generated alone with a data importer.
Here the code
// create an url vor verify link with some variables: key, post id, and email
$url = add_query_arg( array('email'=>$author->user_email,'approve'=>$post->ID), site_url() );
$content .= '<p><span style="color: #5d1e8e;"><strong><span style="font-size: small;"><span style="font-size: small;"><a style="color: #5d1e8e" href="' . $url . '" >Click para confirmar</a></span></span></strong></span></p>';
Thank you!