Skip to content

Commit

Permalink
compatible with github updater
Browse files Browse the repository at this point in the history
also cleanup readme and add language file pot
  • Loading branch information
navidkashani committed Nov 1, 2014
1 parent 3198e04 commit 018c5bf
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 62 deletions.
63 changes: 8 additions & 55 deletions README.md
@@ -1,62 +1,13 @@
# ACF Field Type Template
# ACF Hue Color Picker Field

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-hue.php`: Main plugin file that includes the correct field file based on the ACF version
* `hue-v5.php`: Field class compatible with ACF version 5
* `hue-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 `hue` throughout the file names and code. Use the following list of placeholders to do a 'find and replace':

* `hue`: Single word, no spaces. Underscores allowed. eg. donate_button
* `Hue`: 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 seperated list of relevant tags
* `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 `hue-v5.php` and `hue-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:
* http://www.advancedcustomfields.com/resources/tutorials/creating-a-new-field-type/

### step 3.

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

-----------------------

# ACF Hue Field

DESCRIPTION
Add Hue Color Picker field type to advanced custom field.

-----------------------

### Description

EXTENDED_DESCRIPTION

### Compatibility

This ACF field type is compatible with:
* ACF 5
* ACF 4

### Installation

Expand All @@ -67,12 +18,14 @@ This ACF field type is compatible with:

### Changelog

## 1.1.0 ##
#### 1.2.0
* Compatible with [Github Updater](https://github.com/afragen/github-updater)

#### 1.1.0
* Add saturate and Lightness default value
* Bug fix: Hue Label
* bug fix: load more than a field
* bug fix: 0 value

## 1.0.0 ##
* Initial Release.

#### 1.0.0
* Initial Release.
2 changes: 1 addition & 1 deletion acf-hue-v5.php → acf-hue-color-picker-v5.php
Expand Up @@ -668,4 +668,4 @@ function delete_field( $field ) {
// create field
new acf_field_hue_color_picker();

?>
?>
7 changes: 4 additions & 3 deletions acf-hue.php → acf-hue-color-picker.php
@@ -1,14 +1,15 @@
<?php

/*
Plugin Name: Advanced Custom Fields: Hue Color Picker
Plugin URI: https://github.com/reyhoun/acf-hue-color-picker
Description: It's a field that user can choose Color by hue.
Version: 1.1.0
Version: 1.2.0
Author: Reyhoun
Author URI: http://reyhoun.com/
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
GitHub Plugin URI: https://github.com/reyhoun/acf-hue-color-picker
GitHub Branch: master
*/


Expand All @@ -21,7 +22,7 @@
// $version = 5 and can be ignored until ACF6 exists
function include_field_types_hue( $version ) {

include_once('acf-hue-v5.php');
include_once('acf-hue-color-picker-v5.php');

}

Expand Down
4 changes: 1 addition & 3 deletions lang/README.md
@@ -1,5 +1,3 @@
# Translations directory

Use this directory to store .po and .mo files.

This directory can be removed if not used.
Use this directory to store .po and .mo files.
39 changes: 39 additions & 0 deletions lang/acf-hue-color-picker-en_US.pot
@@ -0,0 +1,39 @@
msgid ""
msgstr ""
"Project-Id-Version: Advanced Custom Fields: Hue Color Picker\n"
"POT-Creation-Date: 2014-11-01 11:19+0330\n"
"PO-Revision-Date: 2014-11-01 11:20+0330\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.9\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SearchPath-0: .\n"

#: acf-hue-color-picker-v5.php:35
msgid "Hue Color Picker"
msgstr ""

#: acf-hue-color-picker-v5.php:62
msgid "Error! Please enter a higher value"
msgstr ""

#: acf-hue-color-picker-v5.php:98
msgid "Hue Default Value"
msgstr ""

#: acf-hue-color-picker-v5.php:105
msgid "saturate Default Value"
msgstr ""

#: acf-hue-color-picker-v5.php:112
msgid "Lightness Default Value"
msgstr ""

0 comments on commit 018c5bf

Please sign in to comment.