/* add_filter('cbxwpslack_events', 'my_custom_slack_event'); function my_custom_slack_event($events){ $myevent = array(); $myevent['uniqueeventname'] = array( 'title' => __('My Custom event when post published', 'your_lang_domain'), //will be shown in post edit screen 'hook' => 'publish_post', //as defined by wordpress 'accepted_args' => 2, // 'priority' => 10, //if not used then we will use 10 'category' => array( 'section' => 'customcategory', //event category 'title' => __('My Custom Tab', 'your_lang_domain') ), 'message' => __('Hei, New post published !', 'your_lang_domain') ); return array_merge($events, $myevent); } */ /* add_filter('cbxwpslack_events', 'my_custom_slack_event2'); function my_custom_slack_event2($events){ $myevent = array(); $myevent['uniqueeventname'] = array( 'title' => __('My Custom event when post published', 'your_lang_domain'), //will be shown in post edit screen 'hook' => 'publish_post', //as defined by wordpress 'accepted_args' => 2, // 'priority' => 10, //if not used then we will use 10 'category' => array( 'section' => 'customcategory', //event category 'title' => __('My Custom Tab', 'your_lang_domain') ), 'message' => function ($ID, $post) { $author_id = $post->post_author; $author = get_user_by( 'ID', $author_id ); $author_name = $author->display_name; $author_url = get_edit_user_link($author_id); $title = $post->post_title; $permalink = get_permalink($ID); $message = sprintf(__('Post "<%s|%s>" written by User <%s|%s>', 'your_lang_domain'), $permalink, $title, $author_url, $author_name); return $message; } ); return array_merge($events, $myevent); } */ /*
Array
(
    [token] => dSpxMroKXmtTlMUqPDfu3tgK
    [team_id] => T0MT1FUU9
    [team_domain] => cbxwpslack
    [service_id] => 39997520567
    [channel_id] => C0MSYEMB7
    [channel_name] => general
    [timestamp] => 1462789401.000002
    [user_id] => U0MT1RMA6
    [user_name] => ahmedsajjad724
    [text] => code
    [trigger_word] => code
)
*/