This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$certs = LLMS()->certificates(); // our certs class | |
$cert_id = 123; // this should be the WP Post ID of the certificate you created on the admin panel via LLMS | |
$related_post_id = 456; // this is really for record keeping only at the moment | |
// should be the WP post id of the course, lesson, or section which | |
// the student has completed to earn the certificate | |
$students = new WP_User_Query(); // get your students however you see fit | |
if ( ! empty( $students->results ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { exit; } | |
/** | |
* Engagments Class | |
* | |
* Finds and triggers the appropriate engagement | |
*/ | |
class LLMS_Engagements { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'my_manual_achievement' ); | |
function my_manual_achievement() { | |
$user_id = 123; // WP User ID of the user you want to award an achievement to | |
$achievement_id = 456; // WP Post ID of the LifterLMS Achievement Post you want to award to the user | |
$post_id = 5202; // The Releated WP Post ID that triggered the awarding of this achievement. This could be a Course, Lesson, Section, or Quiz ID | |
$achievements = LLMS()->achievements(); | |
$achievements->trigger_engagement( $user_id, $achievement_id, $post_id ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_llms_builder_custom_fields( $fields ) { | |
$fields['lesson']['my_custom_group'] = array( | |
// Optional field group title | |
'title' => __( 'My Custom Field Group', 'my-text-domain' ), | |
// if the group can be toggled open/closed | |
'toggleable' => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't copy this line to your functions.php file! | |
/** | |
* Add custom dashboard tabs / urls to the dashboard navigation | |
* @param array $tabs existing tabs | |
* @return array | |
*/ | |
function my_custom_dashboard_tabs( $tabs ) { | |
// save the signout tab | |
$signout = $tabs['signout']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't copy this to functions.php file | |
/** | |
* Add custom merge codes to an LLMS certificate | |
* @param int $user_id WP_User ID | |
* @param int $cert_id WP_Post ID of the generated certificate | |
* @param int $related_post_id WP_Post ID of the post which triggered the certificate generation | |
* @return void | |
*/ | |
function my_custom_cert_merge_codes( $user_id, $cert_id, $related_post_id ) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't copy this to your functions.php file | |
/** | |
* Output data for a custom column on the student reporting table/export | |
* @param string $value default value being output | |
* @param string $key name of the custom field being output | |
* @param obj $student LLMS_Student for the row | |
* @param string $context output context "display" or "export" | |
* @return mixed | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Don't copy this line to your wp-config.php file! | |
// MailChimp | |
define( 'LLMS_MAILCHIMP_API_KEY', 'YOUR-API-KEY-GOES-HERE' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't copy this line to your wp-config.php file! | |
// Sandbox (Test) API Credentails. | |
define( 'LLMS_AUTH_DOT_NET_TEST_CLIENT_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ); | |
define( 'LLMS_AUTH_DOT_NET_TEST_LOGIN_ID', 'XXXXXXXXX' ); | |
define( 'LLMS_AUTH_DOT_NET_TEST_TRANSACTION_KEY', 'XXXXXXXXXXXX' ); | |
// Production (Live) API Credentails. | |
define( 'LLMS_AUTH_DOT_NET_LIVE_CLIENT_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ); | |
define( 'LLMS_AUTH_DOT_NET_LIVE_LOGIN_ID', 'XXXXXXXXX' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Don't include this line in your functions.php file! | |
add_filter( 'llms_mc_enable_consent', '__return_false' ); |
NewerOlder