定制 mmirus/gravity-forms-data-attributes 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mmirus/gravity-forms-data-attributes

最新稳定版本:1.1.1

Composer 安装命令:

composer require mmirus/gravity-forms-data-attributes

包简介

Add custom data attributes to Gravity Forms fields.

README 文档

README

This plugin allows you to add custom data attributes to Gravity Forms fields.

It should work with:

  • all of the Standard field types
  • any of the Advanced field types that only have one input field (e.g., Email but not Address)
  • the List advanced field type, including with multiple columns (thanks @reddo!).

For fields with choices, such as checkboxes, you can assign separate values for each data attribute for each choice (the UI for this is ugly right now 🤷‍).

Usage

For each field you want to enable data attributes for:

  1. On the field's General settings tab, check the Enable Data Attributes box.
  2. In the Data Attribute Names field that appears, enter one data attribute name (e.g., my-attribute) per line.
    • Do not prefix your attribute name with data-. The plugin will do that for you,
  3. Save your form.
  4. Reopen the field settings. You will now see additional setting fields where you can enter the value of each data attribute you added.
    • For fields with choices, such as checkboxes, the data attribute value settings appear next to each choice's name and value fields.
    • For other fields, the data attribute value settings will appear underneath the Data Attribute Names field.

Installation

There are three options for installing this plugin:

  1. With composer from Packagist: composer require mmirus/gravity-forms-data-attributes
  2. With GitHub Updater
  3. By downloading the latest release ZIP from this repository and installing it like any normal WordPress plugin

Contributing

To work on this project (for yourself or to contribute a PR):

  1. Clone this repo
  2. Run composer install
  3. Run yarn or npm install

And you should be good to go.

Pre-commit linting is enforced (see .eslintrc.js and .stylelintrc.js for scripts and styles; PHP uses PSR-2).

Screenshots

Settings for a field without choices

Alt Text

Settings for a field with choices (checkboxes)

Alt Text

统计信息

  • 总下载量: 1.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-01