Bird
0
0

Which syntax correctly registers a new Gutenberg block in JavaScript?

easy📝 Syntax Q3 of 15
Wordpress - Content Management
Which syntax correctly registers a new Gutenberg block in JavaScript?
AregisterBlockType('my-plugin/block', EditComponent, SaveComponent);
BregisterBlock('my-plugin/block', EditComponent, SaveComponent);
CregisterBlockType('my-plugin/block', { edit: EditComponent, save: SaveComponent });
DregisterBlock('my-plugin/block', { edit: EditComponent, save: SaveComponent });
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct function name

    The correct function to register a block is registerBlockType.
  2. Step 2: Check the argument structure

    It takes a string name and an object with edit and save properties.
  3. Final Answer:

    registerBlockType('my-plugin/block', { edit: EditComponent, save: SaveComponent }); -> Option C
  4. Quick Check:

    Correct function and object syntax = registerBlockType('my-plugin/block', { edit: EditComponent, save: SaveComponent }); [OK]
Quick Trick: Use registerBlockType with name and object [OK]
Common Mistakes:
  • Using registerBlock instead of registerBlockType
  • Passing components directly instead of in an object
  • Mixing argument order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes