post(); ?> the_touch_icon(); ?>
the_results(); ?>
'#random', 'username' => 'post-slack-message', 'text' => 'ko-ni-chi-wa!', 'icon_emoji' => ':ghost:', ); public function __construct() { $this->receive_query(); } /** * Show icon-url link tag. */ public function the_touch_icon() { if ( isset($this->touch_icon) && !empty($this->touch_icon)) { ?> $value ) { // Allows empty string to set empty switch ( $key ) { case 'webhook_url': $this->webhook_url = $_GET[$key]; break; case 'touch_icon': $this->touch_icon = $_GET[$key]; break; default: if ( isset($this->payload[$key])) { $this->payload[$key] = $_GET[$key]; } break; } } } public function the_results() { ?> payload as $key => $value ) { ?> Slack response: slack_response; ?> payload ); $this->curl_handler = curl_init( $this->webhook_url ); curl_setopt( $this->curl_handler, CURLOPT_POST, true ); curl_setopt( $this->curl_handler, CURLOPT_POSTFIELDS, $request_body ); curl_setopt( $this->curl_handler, CURLINFO_HEADER_OUT, true ); $this->slack_response = curl_exec( $this->curl_handler ); curl_close( $this->curl_handler ); } }