最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

WordPress Block Variation for Gallery Columns

programmeradmin4浏览0评论

I had this code to extend the column count to 10 for a specific need.

wp.blocks.registerBlockVariation('core/gallery', {
  name: 'prefix-gallery',
  title: 'Custom Gallery',
  attributes: {
    columns: 10,
  },
  isDefault: true,
});

But that doesn't seem to work any longer. I see the updated Block Gallery attributes has this:

attributes: {
  {
    columns: {
      "type": "number",
      "minimum": 1,
      "maximum": 10,
    },
  },
}

So I tried:

wp.blocks.registerBlockVariation('core/gallery', {
  name: 'prefix-gallery',
  title: 'Custom Gallery',
  attributes: {
    columns: {
      minimum: 1,
      maximum: 10,
    },
  },
  isDefault: true,
});

That doesn't seem to work to extend the column count to 10.

Anyone now how to adjust the block variation to 10 instead of the default 8?

发布评论

评论列表(0)

  1. 暂无评论