LifterLMS WooCommerce Hooks

Overview

If you’re not sure what a filter is and want to get started, take a look at the WordPress Codex reference on filters and the core function, add_filter().

Filters can be added to your theme’s or child theme’s functions.php file or to a site-specific plugin. We’ve created a very basic site specific for this purpose, you can get it for free here.

If you’re a developer and you’re looking to filter something, you probably can. If it’s not listed here please check the codebase first and then submit a support ticket if you need help locating a filter.

Actions

llms_wc_updated

Runs after LifterLMS WooCommerce is updated.

Since 1.3.6
Version 2.0.0

llms_wc_before_install

Runs before LifterLMS WooCommerce DB ugrades are run.

Since 2.0.0
Version 2.0.0

llms_wc_after_install

Runs after LifterLMS WooCommerce DB ugrades are run.

Since 2.0.0
Version 2.0.0

llms_wc_updates_queued

Runs when LifterLMS WC Updates are queued before they’re saved and dispatched.

Since 2.0.0
Version 2.0.0

Filters

llms_wc_add_{$type}_notes

Determine whether or not notes should be recorded on a WC Order when enrollment or unenrollment occurs.
{$type} can be either “enrollment” or “unenrollment”.

Since 1.3.0
Version 1.3.0

Parameters
bool $bool Whether or not to record notes. Defaults to true.

llms_wc_account_endpoints

Modify the LifterLMS dashboard endpoints which can be added to the WC My Account page as custom tabs.

Since 1.3.6
Version 1.3.6

Parameters
array $endpoints Array of endpoint data.

llms_wc_members_only_button_html

Modify the HTML of a WC Product “Members Only” button.

Since 2.0.0
Version 2.0.0

Parameters
string $html HTML of the button.
int $post_id WP_Post_ID of the WC product or product variation.

llms_wc_members_only_button_default_text

Modify the default text of a WC Product “Members Only” button.
This text only shows up if the postmeta value is empty.

Since 2.0.0
Version 2.0.0

Parameters
string $text Default text of the button.
int $post_id WP_Post_ID of the WC product or product variation.

llms_wc_members_only_button_text

Modify the text of a WC Product “Members Only” button.

Since 2.0.0
Version 2.0.0

Parameters
string $text Saved text of the button.
int $post_id WP_Post_ID of the WC product or product variation.

llms_wc_unenrollment_new_status

Customize the student unenrollment status when the student is unenrolled as a result of WC order status changes.

Since 2.0.0
Version 2.0.0

Example add_filter( 'llms_wc_plan_has_wc_product', '__return_false' );

Parameters
string $status The new status, should be a valid LifterLMS enrollment status. Defaults to ‘expired’.
int $order_id WC_Post ID of the WooCommerce Order.

llms_wc_allowed_relationship_types

Determines what post types can be associated with a WooCommerce product.

Since 2.0.0
Version 2.0.0

Parameters
array $post_types Indexed array of post types. Default is [ ‘course’, ‘llms_membership’ ].

llms_wc_trigger_registration_actions

Determine if LifterLMS registration actions should be triggered during WooCommerce account registration.

Since 2.0.0
Version 2.0.0

Example add_filter( 'llms_wc_plan_has_wc_product', '__return_false' );

Parameters
bool $bool Whether or not to trigger LLMS actions. Defaults to true.
int $customer_id WP_User ID of the customer
array $data Associative array of customer information.

llms_wc_customer_keys_map

Maps WooCommerce customer information fileds to LifterLMS customer information fields.

Since 2.0.0
Version 2.0.0

Parameters
array $array Associative array where the key is the WC field name and the value is the LLMS field name.

llms_wc_plan_has_wc_product

Modify the default return of the llms_wc_plan_has_wc_product() function
which determines if an LLMS_Access_Plan has an associated WC Product

Since 2.0.0
Version 2.0.0

Example add_filter( 'llms_wc_plan_has_wc_product', '__return_false' );

Parameters
bool $bool whether or not the plan has a WooCommerce product.
obj $plan LLMS_Acces_Plan object.

Last Updated on
Was this article helpful?