index.js
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* LearnDash Block ld-exam
*
* @since 4.0.0
* @package LearnDash
*/
import { __, _x, sprintf } from "@wordpress/i18n";
import { registerBlockType } from "@wordpress/blocks";
import { InnerBlocks } from "@wordpress/block-editor";
/**
* LearnDash block functions
*/
import { ldlms_get_custom_label } from "../ldlms.js";
import Edit from "./edit";
export const settings = {
block_key: "learndash/ld-exam",
block_title: sprintf(
// translators: placeholder: Challenge Exam.
_x( "LearnDash %s", "placeholder: Challenge Exam", "learndash" ),
ldlms_get_custom_label( "exam" )
),
block_description: sprintf(
// translators: placeholder: Create a Challenge Exam.
_x( "Create a %s", "placeholder: Create a Challenge Exam", "learndash" ),
ldlms_get_custom_label( "exam" )
),
};
registerBlockType( settings.block_key, {
title: settings.block_title,
description: settings.block_description,
icon: "editor-help",
category: "learndash-blocks",
supports: {
html: false,
},
attributes: {
ld_version: {
type: "string",
},
},
edit: Edit,
save: () => <InnerBlocks.Content />,
} );