kmdigital/acf-block-builder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kmdigital/acf-block-builder

Composer 安装命令:

composer require kmdigital/acf-block-builder

包简介

A wrapper around ACF Builder for registering ACF Blocks.

README 文档

README

A light wrapper around ACF Builder for registering ACF Blocks. Default usage is for Sage 10, however, other themes are supported.

Installation

Within your theme or plugin:

$ composer require kmdigital/acf-block-builder

Usage

use KMDigital\AcfBlockBuilder\Block;

$testimonial = new Block('testimonial');

$testimonial
    ->addWysiwyg('content')
    ->addText('person')
    ->addText('where')
    ->addText('when');

add_action('acf/init', function () use ($testimonial) {
    acf_add_local_field_group($testimonial->build());
});

There are additional methods you can use for setting and overriding block options:

$testimonial
  // Allows you to set a custom title for the block. 
  // Default is the block name/slug titlized.
  ->setTitle('Review')

  // Allows you to set the block description. Default is none.
  ->setDescription('A review with meta.')

  // Allows you to set the block description. Default is a block.
  ->setIcon('star-half')

  // Allows you to set the block category. Default is none.
  ->setCategory('common')

  // Allows you to set the block keywords. Default is none.
  ->setKeywords('review', 'testimonial')

  // Allows you to use a different rendering function. Default is Sage 10 (Acorn).
  ->renderWith(['Me\\View\\', 'render']);

Default rendering function

The default rendering function is for Sage 10 or projects using Acorn. It searches for templates in resources/views/blocks (if resources/views is your default views path).

统计信息

  • 总下载量: 557
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固