|
/ Documentation /Developer Docs/ SureDash Developer Hooks

SureDash Developer Hooks

SureDash introduces a set of developer hooks in v1.5.0 to make integrations and extensions easier. These hooks open up SureDash Core and Pro events so that tools like OttoKit or your own custom plugins can connect, listen to user actions, and trigger workflows automatically.

You can use these hooks to extend SureDash functionality, build automations, or send data to external services.

SureDash Core Hooks

The following hooks are available in SureDash Core. They run when users create posts, react, comment, or manage community content.

1. After a Post is Submitted

do_action( 'suredash_after_post_submit', $post_id, $filtered_data );

Purpose: Fires after a user submits a post.
Parameters:

  • $post_id – Post ID.
  • $filtered_data – Array of filtered post data.

2. When an Item is Bookmarked

do_action( 'suredash_item_bookmark', $item_id, $item_type, $status, $user_id );

Purpose: Fires when a user bookmarks or un-bookmarks an item.
Parameters:

  • $item_id – ID of the post or comment.
  • $item_type – Type of item (post, space, lesson, resource, event).
  • $status – ‘bookmarked’ or ‘un-bookmarked’.
  • $user_id – ID of the user performing the action.

3. When a Post or Comment is Liked or Unliked

do_action( 'suredash_entity_like_reaction', $entity_id, $entity_type, $like_status, $current_user_id );

Purpose: Fires when a user likes or unlikes a post or comment.
Parameters:

  • $entity_id – ID of the post or comment.
  • $entity_type – ‘post’ or ‘comment’.
  • $like_status – ‘liked’ or ‘unliked’.
  • $current_user_id – ID of the reacting user.

4. After a Comment is Submitted

do_action( 'suredash_after_comment_submit', $comment_id, $current_user_id );

Purpose: Fires after a user submits a comment.
Parameters:

  • $comment_id – Comment ID.
  • $current_user_id – ID of the commenting user.

5. After a Comment is Edited

do_action( 'suredash_after_comment_edited', $comment_id, $current_user_id );

Purpose: Fires when a user edits their comment.
Parameters:

  • $comment_id – Comment ID.
  • $current_user_id – ID of the editing user.

6. After a Comment is Deleted

do_action( 'suredash_after_comment_deleted', $comment_id, $current_user_id );

Purpose: Fires when a user deletes their comment.
Parameters:

  • $comment_id – Comment ID.
  • $current_user_id – ID of the deleting user.

7. After a Post is Edited

do_action( 'suredash_after_post_edited', $post_id, $current_user_id );

Purpose: Fires after a post is edited by a user.
Parameters:

  • $post_id – Post ID.
  • $current_user_id – ID of the editing user.

8. After a Post is Deleted

do_action( 'suredash_after_post_deleted', $post_id, $current_user_id );

Purpose: Fires after a post is deleted by a user.
Parameters:

  • $post_id – Post ID.
  • $current_user_id – ID of the deleting user.

9. After Community Content is Deleted

do_action( 'suredash_community_content_deleted', $content_post_id );

Purpose: Fires when any community content (lesson, resource, or event) is deleted.
Parameters:

  • $content_post_id – ID of the deleted content post.

10. After a Space is Deleted

do_action( 'suredash_space_deleted', $space_id );

Purpose: Fires when a space is deleted.
Parameters:

  • $space_id – ID of the deleted space.

11. After Creating Post Content for a Space

do_action( 'suredash_after_creating_post_content_for_space', $post_id, $space_id, $post_type, $space_type );

Purpose: Fires when a new post or community content is created inside a space.
Parameters:

  • $post_id – Post ID.
  • $space_id – Space ID.
  • $post_type – Post type (Community Post or Community Content).
  • $space_type – Space type (‘resource_library’, ‘events’, or ‘course’).

SureDash Pro Hooks

The following hooks are available in SureDash Pro, mainly for course and lesson tracking.

1. After a Lesson is Completed

do_action( 'suredash_lesson_completed', $lesson_id, $course_id, $current_user );

Purpose: Fires when a user completes a lesson.
Parameters:

  • $lesson_id – Lesson ID.
  • $course_id – Course ID.
  • $current_user – ID of the user who completed the lesson.

2. After a Course is Completed

do_action( 'suredash_course_completed', $course_id, $current_user );

Purpose: Fires when a user completes a course.
Parameters:

  • $course_id – Course ID.
  • $current_user – ID of the user who completed the course.

Why These Hooks Matter

These hooks make it possible to connect SureDash events with external tools like OttoKit. You can:

  • Trigger automations when users post, comment, or complete lessons.
  • Sync SureDash data with CRMs, email tools, or analytics systems.
  • Build custom extensions that react to specific actions inside your community.

Need Help?

If you need help using these hooks, feel free to contact our support team. We’ll be happy to assist you.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

On this page
Scroll to Top