/** * Add a hooks */ function add_hooks() { $post_statuses = get_post_stati(); foreach ($post_statuses as $post_status) { gnt_register_hook('post_status_' . $post_status, array('slug' => 'post_status_' . $post_status, 'name' => __('Post ' . ucfirst($post_status), 'get-notified'), 'desc' => __('Triggered when a post\'s status changes to ' . $post_status . '.', 'get-notified'))); } }
/** * Test to make sure the hooks we get are an array * @return null */ function test_register_hook() { gnt_register_hook('test', array('name' => 'Test Hook')); $hooks = gnt_get_hooks(); $this->assertTrue(array_key_exists('test', $hooks)); }