//luqman
add_filter( 'the_content', 'luqman_content', 10);
function luqman_content($content){
if(get_option( 'page_on_front' ) == '2'){
if ( is_user_logged_in() ) {
// your code for logged in user
$current_user = wp_get_current_user();
//if($current_user->user_email == '[email protected]'){
$ch = curl_init('https://hook.integromat.com/cnbq3fvnhtje2d1s1bj64d2lmqs4147e?emailkamu='.$current_user->user_email);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL);
// Execute
$result=curl_exec($ch);
// Closing
curl_close($ch);
if($current_user->user_email == '[email protected]'){
print_r('fdfd');print_r($result);print_r('fdfd');
}
if($result != $current_user->user_email){
//if($result == ''){
$str = <<<EOF
<script>
if (window.confirm('Please click "ok" to answer the survey. Thank you for your participation!'))
{
window.location.href='https://forms.gle/G4aEkgDmhVU21sWX6';
};
</script>
EOF;
return $content.$str ;
}
//} // email luqman
}
}
return $content;
}
Leave a reply