Last active
September 27, 2018 04:00
-
-
Save actual-saurabh/4e5c5b24940b9fa70da8b8343da6ec4f to your computer and use it in GitHub Desktop.
Complex Micro Example - Dummy Functionality
This file contains 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 | |
/** | |
* This can override the LifterLMS Class | |
* However, then we'll have to hook this one before loading LifterLMS itself | |
* This file can be included by LifterLMS by filtering the autoloader | |
* Include Override: lifterlms/includes/forms/controllers/class.llms.controller.login.php | |
*/ |
This file contains 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 | |
/** | |
* This file will just be included as it is into micro.php | |
*/ | |
defined( 'ABSPATH' ) || exit; | |
// write php here |
This file contains 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
{ | |
"name": "llms/dummy-micro", | |
"title": "Dummy Micro", | |
"version": "1.0.0", | |
"description": "This Dummy Micro adds a dancing baboon to your site.", | |
"homepage": "https://lifterlms.com", | |
"author": "saurabhshukla", | |
"tags": [ "onboarding", "membership", "course" ], | |
"plugins": [ "llms-woocommerce-integration", "woocommerce" ], | |
"themes": [ "lifterlms-launchpad", "wp-astra" ], | |
"template_overrides": [ | |
{ | |
"template": "global/sidebar.php", | |
"override": "sidebar.php" | |
} | |
], | |
"include_overrides": [ | |
{ | |
"include": "lifterlms/includes/forms/controllers/class.llms.controller.login.php", | |
"override": "class.llms.controller.login.php" | |
} | |
], | |
} |
This file contains 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 | |
/** | |
* The main file that is included and run on the "plugins_loaded" action | |
* - Write some PHP Code | |
* - Include other files | |
* - Enqueue custom css and js | |
* - See LLMS Micros Developer API Documentation for more: | |
*/ | |
defined( 'ABSPATH' ) || exit; | |
function_exists( 'llms_dummy_enqueue_script' ) && exit; | |
// global $llms_micros; | |
add_action( 'wp_enqueue_scripts', 'llms_dummy_enqueue_script' ); | |
function llms_dummy_enqueue_script() { | |
global $llms_micros; | |
$options = $llms_micros[ 'dummy-micro' ]; | |
wp_enqueue_script( 'dummy-micro-handle', $options->url . "public.js", array('llms'), $options->version ); | |
} | |
include_once( $llms_micros[ 'dummy-micro' ]->path . 'include.php' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment