• I noticed that the class name this block currently has is wp-block-magicblock-magicblock. Was the double magicblock part intentional or should it be wp-block-magicblock ?

Viewing 1 replies (of 1 total)
  • Plugin Author willdelphia

    (@willdelphia)

    So that particular classname is assigned by the Block API based on the name of the block which is registered…

    From the docs:
    block-api/block-registration

    The name for a block is a unique string that identifies a block. Names have to be structured as namespace/block-name, where namespace is the name of your plugin or theme.

    I believe this namespace/block-name convention is so that a given plugin can register many blocks without worrying if they are conflicting with the names of blocks that other plugins might be registering.

    In this case, the plugin only registers a single block. Magicblock is both the name of the plugin (namespace) and the name of the block. That’s why it’s getting doubled in the classname.

    Hope that makes sense.

    • This reply was modified 6 years, 2 months ago by willdelphia.
Viewing 1 replies (of 1 total)
  • The topic ‘Block class name’ is closed to new replies.