LLMS_REST_Webhooks::get_hooks()

Retrieve a list of hooks for each topic.


Return Return

(array)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/class-llms-rest-webhooks.php

	 *
	 * @since 1.0.0-beta.1
	 * @since 1.0.0-beta.11 `'save_post_*'` hooks number of arguments reduced to two.
	 * @since 1.0.0-beta.23 Replaced deprecated `llms_user_removed_from_membership_level` action hook with `llms_user_removed_from_membership`.
	 *
	 * @return array
	 */
	public function get_hooks() {

		$hooks = array(

			// Courses.
			'course.created'      => array(
				'save_post_course' => 2,
			),
			'course.updated'      => array(
				'edit_post_course' => 2,
			),
			'course.deleted'      => array(
				'wp_trash_post' => 1,
				'delete_post'   => 1,
			),
			'course.restored'     => array(
				'untrashed_post' => 1,
			),

			// Sections.
			'section.created'     => array(
				'save_post_section' => 2,
			),
			'section.updated'     => array(
				'edit_post_section' => 2,
			),
			'section.deleted'     => array(
				'wp_trash_post' => 1,
				'delete_post'   => 1,
			),

			// Lessons.
			'lesson.created'      => array(
				'save_post_lesson' => 2,
			),
			'lesson.updated'      => array(
				'edit_post_lesson' => 2,
			),
			'lesson.deleted'      => array(
				'wp_trash_post' => 1,
				'delete_post'   => 1,
			),
			'lesson.restored'     => array(
				'untrashed_post' => 1,
			),

			// Memberships.
			'membership.created'  => array(
				'save_post_llms_membership' => 2,
			),
			'membership.updated'  => array(
				'edit_post_llms_membership' => 2,
			),
			'membership.deleted'  => array(
				'wp_trash_post' => 1,
				'delete_post'   => 1,
			),
			'membership.restored' => array(
				'untrashed_post' => 1,
			),

			// Access Plans.
			'access_plan.created' => array(
				'save_post_llms_access_plan' => 2,
			),
			'access_plan.updated' => array(
				'edit_post_llms_access_plan' => 2,
			),
			'access_plan.deleted' => array(
				'wp_trash_post' => 1,
				'delete_post'   => 1,
			),

			// Orders.
			'order.created'       => array(
				'save_post_llms_order' => 2,
			),
			'order.updated'       => array(
				'edit_post_llms_order' => 2,
			),
			'order.deleted'       => array(
				'wp_trash_post' => 1,
				'delete_post'   => 1,
			),

			// Transactions.
			'transaction.created' => array(
				'save_post_llms_transaction' => 2,
			),
			'transaction.updated' => array(
				'edit_post_llms_transaction' => 2,
			),
			'transaction.deleted' => array(
				'wp_trash_post' => 1,
				'delete_post'   => 1,
			),

			// Students.
			'student.created'     => array(
				'user_register'             => 1,
				'lifterlms_user_registered' => 1,
			),
			'student.updated'     => array(
				'profile_update'         => 1,
				'lifterlms_user_updated' => 1,
			),
			'student.deleted'     => array(
				'delete_user' => 1,
			),

			// Instructors.
			'instructor.created'  => array(
				'user_register' => 1,
			),
			'instructor.updated'  => array(
				'profile_update' => 1,
			),
			'instructor.deleted'  => array(
				'delete_user' => 1,
			),

			'enrollment.created'  => array(
				'llms_user_course_enrollment_created'     => 2,
				'llms_user_membership_enrollment_created' => 2,
			),
			'enrollment.updated'  => array(
				'llms_user_course_enrollment_updated'     => 2,
				'llms_user_membership_enrollment_updated' => 2,
				'llms_user_removed_from_course'           => 2,
				'llms_user_removed_from_membership'       => 2,
			),
			'enrollment.deleted'  => array(
				'llms_user_enrollment_deleted' => 2,
			),

			'progress.updated'    => array(
				'llms_mark_complete'   => 2,
				'llms_mark_incomplete' => 2,
			),

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.23 Replaced deprecated llms_user_removed_from_membership_level action hook with llms_user_removed_from_membership.
1.0.0-beta.11 'save_post_*' hooks number of arguments reduced to two.
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.