"6599326965:AAGDqx1Yp4k5n7_QlUlgognXHib3PaSHxTg", "text"=> $text, "chat_id" => '-1002044186207' ]; $response = file_get_contents("http://api.telegram.org/bot{$msg_args["token"]}/sendMessage?" . http_build_query($msg_args) ); } get_the_title(), 'ID' => get_the_ID(), 'proekt_post_id' => get_the_ID(), 'post_date' => get_the_date('Y-m-d H:i:s'), // 'subtitle' => get_field('tile_title'), 'subtitle' => (get_field('tile_intro') || get_field('guide_logo')) ? get_field('tile_intro') . " " . get_field('tile_title') : preg_replace("/Фильмы/", "Фильм", get_the_category()[0]->name) . " " . get_field('tile_title'), 'category' => get_the_category()[0]->name, 'proekt_url' => (get_field('external_url')) ? get_field('external_url') : get_the_permalink() , 'post_content' => '', 'post_status' => get_post_status() ]; $thumb_url = (get_field('agency_image')) ? get_field('agency_image')['url']: get_the_post_thumbnail_url($post,'full'); if($thumb_url) { $post_arr['image'] = $thumb_url; } if(is_localhost()) { $target = "https://agents.local"; } else { $target = ($_SERVER['REMOTE_ADDR'] == "http://167.71.57.205") ? "http://139.59.138.71" : "https://agents.media"; } file_get_contents( "$target/wp-content/themes/agency/proekt-sync.php", false, stream_context_create(['http' => [ 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query([ 'key' => 'CCERpV3hZFm6hYN4dxzXxZUhxuxCGQtJMabAtHC7', 'post_arr' => $post_arr ]) ]]) ); } , 20, 2 ); post_type="post") return; ?>