GithubHelp home page GithubHelp logo

arkadiuszsz / acf-field-type-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from advancedcustomfields/acf-field-type-template

0.0 1.0 0.0 362 KB

ACF Field Type Template

PHP 93.74% JavaScript 6.26%

acf-field-type-template's Introduction

ACF Field Type Template

Welcome to the Advanced Custom Fields field type template repository. Here you will find a starter-kit for creating a new ACF field type. This start-kit will work as a normal WP plugin.

For more information about creating a new field type, please read the following article: http://www.advancedcustomfields.com/resources/tutorials/creating-a-new-field-type/

Structure

  • /css: folder for .css files.
  • /images: folder for image files
  • /js: folder for .js files
  • /lang: folder for .pot, .po and .mo files
  • acf-FIELD_NAME.php: Main plugin file that includes the correct field file based on the ACF version
  • FIELD_NAME-v5.php: Field class compatible with ACF version 5
  • FIELD_NAME-v4.php: Field class compatible with ACF version 4
  • readme.txt: WordPress readme file to be used by the WordPress repository

step 1.

This template uses PLACEHOLDERS such as FIELD_NAME throughout the file names and code. Use the following list of placeholders to do a 'find and replace':

  • FIELD_NAME: Single word, no spaces. Underscores allowed. eg. donate_button
  • FIELD_LABEL: Multiple words, can include spaces, visible when selecting a field type. eg. Donate Button
  • PLUGIN_URL: Url to the github or WordPress repository
  • PLUGIN_TAGS: Comma separated list of relevant tags
  • SHORT_DESCRIPTION: Brief description of the field type, no longer than 2 lines
  • EXTENDED_DESCRIPTION: Extended description of the field type
  • AUTHOR_NAME: Name of field type author
  • AUTHOR_URL: URL to author's website

step 2.

Edit the FIELD_NAME-v5.php and FIELD_NAME-v4.php files (now renamed using your field name) and include your custom code in the appropriate functions. Please note that v4 and v5 field classes have slightly different functions. For more information, please read:

step 3.

Edit this README.md file with the appropriate information and delete all content above and including the following line.


ACF FIELD_LABEL Field

SHORT_DESCRIPTION


Description

EXTENDED_DESCRIPTION

Compatibility

This ACF field type is compatible with:

  • ACF 5
  • ACF 4

Installation

  1. Copy the acf-FIELD_NAME folder into your wp-content/plugins folder
  2. Activate the FIELD_LABEL plugin via the plugins admin page
  3. Create a new field via ACF and select the FIELD_LABEL type
  4. Please refer to the description for more info regarding the field type settings

Changelog

Please see readme.txt for changelog

acf-field-type-template's People

Contributors

beaucharman avatar binarykitten avatar dboulet avatar elliotcondon avatar lgladdy avatar shaunbent avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.