PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / assets / src / apps / js / blocks / course-elements / course-title / index.js

index.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.8, at assets/src/apps/js/blocks/course-elements/course-title/index.js

36 lines 905 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Register block course title.
3 */
4 import edit from './edit';
5 import { save } from './save';
6 import metadata from './block.json';
7 import { registerBlockType } from '@wordpress/blocks';
8 import { checkTemplatesCanLoadBlock } from '../../utilBlock.js';
9 import { title } from '@wordpress/icons';
10
11 const templatesName = [
12 'learnpress/learnpress//single-lp_course',
13 'learnpress/learnpress//single-lp_course-offline',
14 ];
15
16 /**
17 * Check if the block can load in the template editor: single-lp_course.
18 * if it is editing on this template, set ancestor to null
19 */
20 checkTemplatesCanLoadBlock( templatesName, metadata, ( metadataNew ) => {
21 registerBlockType( metadataNew.name, {
22 ...metadataNew,
23 icon: title,
24 edit,
25 save,
26 } );
27 } );
28
29 // Register the block with the original metadata, ancestor will be set on block.json
30 registerBlockType( metadata.name, {
31 ...metadata,
32 icon: title,
33 edit,
34 save,
35 } );
36