Action and Filter Hooks

LinkedInFacebookTwitterGoogle+Share

Actions

Below is a list of the action hooks included in BadgeOS, along with their purpose and the params they pass. Learn how to tap into these hooks with add_action().

badgeos_create_log_entry

  • Purpose: Fires whenever a log entry is created
  • Parameters:
    • $log_post_id
    • $post_id
    • $user_id
    • $action

badgeos_settings

  • Purpose: Add additional BadgeOS settings options
  • Parameters:
    • $badgeos_settings

credly_settings

  • Purpose: Add additional Credly settings options
  • Parameters:
    • $credly_settings

badgeos_new_{$post_type}

  • Purpose: Triggers when a new $post_type is created
  • Parameters:
    • $post_id

badgeos_save_nomination

  • Purpose: Save the nomination entry
  • Parameters:
    • $new_post_id

badgeos_save_submission

  • Purpose: Fires when a submission is saved
  • Parameters:
    • $submission_id

badgeos_steps_ui_html_after_require_text

  • Purpose: Generate HTML after getting the required text
  • Parameters:
    • $stpe_id
    • $post_id

badgeos_steps_ui_html_after_trigger_type

  • Purpose: Generate HTML after getting the trigger type
  • Parameters:
    • $step_id
    • $post_id

badgeos_steps_ui_html_after_achievement_type

  • Purpose: Generate HTML after getting the achievement type
  • Parameters:
    • $step_id
    • $post_id

badgeos_steps_ui_html_after_achievement_post

  • Purpose: Generate HTML after getting the achievement post
  • Parameters:
    • $step_id
    • $post_id

badgeos_steps_ui_html_after_count_text

  • Purpose: Generate HTML after getting the count of texts
  • Parameters:
    • $step_id
    • $post_id

badgeos_unlock_{$post_type}

  • Purpose: Unlock an achievement of $post_type
  • Parameters:
    • $achievement_object

badgeos_award_achievement

  • Purpose: Fires when a user is awarded an achievement
  • Parameters:
    • $user_id
    • $achievement_id

badgeos_revoke_achievement

  • Purpose:  Fires when a user has an achievement revoked
  • Parameters:
    • $user_id
    • $achievement_id

badgeos_unlock_all_{$post_type}

    • Purpose:  Fires when all achievements of $post_type have been earned
    • Parameters:
      • $post_type

Filters

Below is a list of the filter hooks included in BadgeOS, along with their purpose and the params they pass. Learn how to tap into these hooks with add_filter().

badgeos_user_deserves_trigger

  • Purpose: To determine if user should have access to a trigger
  • Parameters:
    • $user_id
    • $this_trigger

badgeos_activity_triggers

  • Purpose: Override or extend the core activity triggers
  • Parameters:
    • $triggers

badgeos_nomination_notify_email

  • Purpose: Set the admin email address for nomination
  • Parameters:
    • $adminI_email

badgeos_nomination_notify_subject

  • Purpose: Set the subject of the email for nomination
  • Parameters:
    • $subject

badgeos_nomination_notify_message

  • Purpose: Set the content of the message for nomination
  • Parameters:
    • $message

badgeos_submission_notify_email

  • Purpose: Set the admin email address for submission
  • Parameters:
    • $admin_email

badgeos_submission_notify_subject

  • Purpose: Set the subject of the email for submission
  • Parameters:
    • $subject

badgeos_submission_notify_message

  • Purpose: Set the content of the message for submission
  • Parameters:
    • $message

badgeos_submission_form_language

  • Purpose: Filter the submission form texts
  • Parameters:
    • $defaults

badgeos_comment_form_language

  • Purpose: Filter the comment form texts
  • Parameters:
    • $defaults

badgeos_get_comment_form

  • Purpose: Set the id for the comment form
  • Parameters:
    • $sub_form
    • $post_id

badgeos_get_comments_for_submission

  • Purpose: Get the comments for a submission
  • Parameters:
    • $output
    • $submission_id
    • $comments

badgeos_get_nomination_form

  • Purpose: Display nomination form
  • Parameters:
    • $sub_form

badgeos_get_submission_form

  • Purpose: Display the submission form
  • Parameters:
    • $sub_form

badgeos_get_submissions

  • Purpose: Get the submissions for the current user
  • Parameters:
    • $submissions

badgeos_get_user_submissions

  • Purpose: Override submissions from a specific user for a specific achievement
  • Parameters:
    • $submissions
    • $achievement_id
    • $user_id

badgeos_get_submission_attachments

  • Purpose: Get achievement specific attachments
  • Parameters:
    • $output
    • $submission_id
    • $attachments

badgeos_steps_ui_title

  • Purpose: Get the title for the steps ui meta box
  • Parameters:
    • $title

badgeos_steps_ui_add_new

  • Purpose: Add new step to the meta box
  • Parameters:
    • $step

badgeos_steps_ui_save_all

  • Purpose: Save all of the steps in the meta box
  • Parameters:
    • $steps

badgeos_steps_ui_html_require_text

  • Purpose: Filter requirement text for steps UI
  • Parameters:
    • $output

badgeos_steps_ui_html_count_text

  • Purpose: Filter the the html count for steps UI
  • Parameters:
    • $output

badgeos_get_step_requirements

  • Purpose: Get the requirements of a given step
  • Parameters:
    • $requirements
    • $step_id

badgeos_save_step

  • Purpose: Save given step
  • Parameters:
    • $custom_title
    • $step_id
    • $step

user_has_access_to_achievement

  • Purpose: Checks if the current user can access a specific achievement
  • Parameters:
    • $return
    • $user_id
    • $achievement_id

badgeos_step_activity

  • Purpose:  Gets the current step activity toward an achievement
  • Parameters:
    • $activities
    • $user_id
    • $step_id

user_deserves_achievement

  • Purpose: Checks to see if user fulfils the requirements for a given achievement
  • Parameters:
    • $return
    • $user_id
    • $achievement_id

badgeos_public_steps

  • Purpose: Set steps posts to public (expects bool)
  • Parameters:
    • $public

badgeos_public_submissions

  • Purpose: Set submissions posts to public (expects bool)
  • Parameters:
    • $public

badgeos_public_nominations

  • Purpose: Set nominations posts to public (expects bool)
  • Parameters:
    • $public

badgeos_achievement_data_meta_box

  • Purpose: Filters the achievement data (expects array)
  • Parameters:
    • $achievement_data

badgeos_achievement_data_meta_box_fields

  • Purpose: Sets the metadata for the fields type (expects array)
  • Parameters:
    • $fields

badgeos_achievement_earned_by

  • Purpose: Sets the metadata for the options field (expects array)
  • Parameters:
    • $options

badgeos_step_class

  • Purpose: Overrides the CSS class specific to the step
  • Parameters:
    • $earned_status
    • $step

badgeos_step_title_display

  • Purpose: Filter the output of the title specific to achievements
  • Parameters:
    • $display

badgeos_steps_heading

  • Purpose: Filter the heading for each step specific to achievements
  • Parameters:
    • $count
    • $post_type_object
    • $steps

badgeos_earned_achievement_message

  • Purpose: Returns message for earning achievements
  • Parameters:
    • $earned_message

badgeos_render_achievement’

  • Purpose: Return rendered filterable achievement
  • Parameters:
    • $output
    • $achievement

badgeos_render_feedback

  • Purpose: Returns rendered filterable feedback
  • Parameters:
    • $output
    • $atts

badgeos_render_nomination

  • Purpose: Returns rendered nomination information
  • Parameters:
    • $output
    • $nomination

badgeos_render_submission

  • Purpose: Returns rendered submission information
  • Parameters:
    • $output
    • $submission

badgeos_render_submission_attachment

  • Purpose: Return rendered submission attachment
  • Parameters:
    • $output
    • $attachment

badgeos_render_submission_comment

  • Purpose: Return rendered comment submission
  • Parameters:
    • $output
    • $comment
    • $odd_even

badgeos_render_feedback_buttons

  • Purpose: Return rendered approve or deny button for given feedback
  • Parameters:
    • $output
    • $feedback_id

achievement_object

  • Purpose: Return the achievement object, for extension elsewhere
  • Parameters:
    • $achievement_object

badgeos_dependent_achievements

  • Purpose: Returns earnable achievements once an achievement is earned
  • Parameters:
    • $achievements
    • $achievement_id

badgeos_default_achievement_post_thumbnail

  • Purpose: Returns a proper image thumbnail source
  • Parameters:
    • $thumbnail

badgeos_earners_heading

  • Purpose: Returns a filtered heading for people who have earned a specific achievement
  • Parameters:
    • $achievement_earners

badgeos_get_achievement_earners_list_user

  • Purpose: Return the information of each user who earned a specific achievement
  • Parameters:
    • $user_content
    • $user

badgeos_get_achievement_earners_list

  • Purpose: Return a list of all users who earned a specific achievement
  • Parameters:
    • $output
    • $achievement_id

badgeos_log_entry_title

  • Purpose: Override the post title for a log entry
  • Parameters:
    • $default_title
    • $post_id
    • $user_id
    • $action
    • $achievement
    • $achievement_types

Open Source License Information

Credly, LLC licenses BadgeOS™ to you under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation.

There is NO WARRANTY for this software, express or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License, version 3, at http://www.gnu.org/licenses/agpl-3.0.html for more details.