LLMS_Blocks::init()
Register all blocks & components.
Return Return
(void)
Source Source
File: libraries/lifterlms-blocks/includes/class-llms-blocks.php
public function init() {
if ( ! function_exists( 'llms' ) || ! version_compare( self::MIN_CORE_VERSION, llms()->version, '<=' ) ) {
return;
}
$this->includes();
add_action( 'add_meta_boxes', array( $this, 'remove_metaboxes' ), 999, 2 );
global $wp_version;
$filter = version_compare( $wp_version, '5.8-src', '>=' ) ? 'block_categories_all' : 'block_categories';
add_filter( $filter, array( $this, 'add_block_category' ) );
add_action( 'admin_print_scripts', array( $this, 'admin_print_scripts' ), 15 );
/**
* When loaded as a library included by the LifterLMS core localization is handled by the LifterLMS core.
*
* When the plugin is loaded by itself as a plugin, we must localize it independently.
*/
if ( ! defined( 'LLMS_BLOCKS_LIB' ) || ! LLMS_BLOCKS_LIB ) {
add_action( 'init', array( $this, 'load_textdomain' ), 0 );
}
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 2.5.0 | Updated minimum LifterLMS core version to 7.2.0. |
| 2.2.1 | Handle '-src' in WordPress version numbers. |
| 2.0.0 | Return early if LifterLMS isn't installed, move file inclusion to $this->includes(), and moved actions and filters from the constructor. |
| 1.9.0 | Added course progress block class. |
| 1.4.0 | Add status tools class. |
| 1.0.0 | Introduced. |