# learnpress/4.4.1/assets/src/apps/js/blocks/course-elements/course-title/index.js

LearnPress – WordPress LMS Plugin for Create and Sell Online Courses, version 4.4.1. 36 lines.

- Page: https://pluginprobe.com/plugins/learnpress/4.4.1/code/assets/src/apps/js/blocks/course-elements/course-title/index.js
- Raw: https://pluginprobe.com/plugins/learnpress/4.4.1/raw/assets/src/apps/js/blocks/course-elements/course-title/index.js
- Modified: 2026-06-26T11:19:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/learnpress/4.4.1/code/assets/src/apps/js/blocks/course-elements/course-title/index.js#L10-L20`.

```javascript
/**
 * Register block course title.
 */
import edit from './edit';
import { save } from './save';
import metadata from './block.json';
import { registerBlockType } from '@wordpress/blocks';
import { checkTemplatesCanLoadBlock } from '../../utilBlock.js';
import { title } from '@wordpress/icons';

const templatesName = [
	'learnpress/learnpress//single-lp_course',
	'learnpress/learnpress//single-lp_course-offline',
];

/**
 * Check if the block can load in the template editor: single-lp_course.
 * if it is editing on this template, set ancestor to null
 */
checkTemplatesCanLoadBlock( templatesName, metadata, ( metadataNew ) => {
	registerBlockType( metadataNew.name, {
		...metadataNew,
		icon: title,
		edit,
		save,
	} );
} );

// Register the block with the original metadata, ancestor will be set on block.json
registerBlockType( metadata.name, {
	...metadata,
	icon: title,
	edit,
	save,
} );

```
