├── .editorconfig ├── .gitignore ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock └── src └── helpers.php /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.php] 12 | indent_size = 4 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Brandon Nifong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ACF Fluent Helpers 2 | 3 | ![Latest Stable Version](https://img.shields.io/packagist/v/log1x/acf-fluent-helpers?style=flat-square) 4 | ![Total Downloads](https://img.shields.io/packagist/dt/log1x/acf-fluent-helpers?style=flat-square) 5 | 6 | This is a simple set of helper functions for [ACF Fluent](https://github.com/samrap/acf-fluent) similar to the [`helpers.php`](https://github.com/samrap/acf-fluent/blob/master/src/helpers.php) shipped with ACF Fluent, but is auto-loaded by Composer instead of having to be manually included. 7 | 8 | It also uses really generic function names because I'm naughty. :wink: 9 | 10 | ## Requirements 11 | 12 | Make sure all dependencies have been installed before moving on: 13 | 14 | - [PHP](https://secure.php.net/manual/en/install.php) >= 7.0 15 | - [Composer](https://getcomposer.org/download/) 16 | - [ACF Fluent](https://github.com/samrap/acf-fluent) 17 | 18 | ## Installation 19 | 20 | Install via Composer: 21 | 22 | ```bash 23 | $ composer require log1x/acf-fluent-helpers:dev-master 24 | ``` 25 | 26 | ## Usage 27 | 28 | ```php 29 | $field = field('example')->get(); 30 | $subfield = sub('example')->get(); 31 | $option = option('example')->get(); 32 | ``` 33 | 34 | ## Bug Reports 35 | 36 | If you discover a bug in ACF Fluent Helpers, please [open an issue](https://github.com/log1x/acf-fluent-helpers/issues). 37 | 38 | ## Contributing 39 | 40 | Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated. 41 | 42 | ## License 43 | 44 | ACF Fluent Helpers is provided under the [MIT License](https://github.com/log1x/acf-fluent-helpers/blob/master/LICENSE.md). 45 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "log1x/acf-fluent-helpers", 3 | "type": "package", 4 | "license": "MIT", 5 | "description": "Simple set of helper functions for ACF Fluent auto-loaded with Composer using generic function names.", 6 | "authors": [ 7 | { 8 | "name": "Brandon Nifong", 9 | "email": "brandon@tendency.me" 10 | } 11 | ], 12 | "keywords": [ 13 | "acf", 14 | "advanced-custom-fields", 15 | "acf-fluent" 16 | ], 17 | "support": { 18 | "issues": "https://github.com/log1x/acf-fluent-helpers/issues" 19 | }, 20 | "autoload": { 21 | "files": [ 22 | "src/helpers.php" 23 | ] 24 | }, 25 | "require": { 26 | "php": ">=7.0" 27 | }, 28 | "require-dev": { 29 | "squizlabs/php_codesniffer": "^3.4" 30 | }, 31 | "scripts": { 32 | "lint": [ 33 | "phpcs --ignore=vendor --extensions=php --standard=PSR12 ." 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "46836d250dd57fab3731db706cfbe4d0", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "squizlabs/php_codesniffer", 12 | "version": "3.4.2", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 16 | "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", 21 | "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "ext-simplexml": "*", 26 | "ext-tokenizer": "*", 27 | "ext-xmlwriter": "*", 28 | "php": ">=5.4.0" 29 | }, 30 | "require-dev": { 31 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 32 | }, 33 | "bin": [ 34 | "bin/phpcs", 35 | "bin/phpcbf" 36 | ], 37 | "type": "library", 38 | "extra": { 39 | "branch-alias": { 40 | "dev-master": "3.x-dev" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "BSD-3-Clause" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Greg Sherwood", 50 | "role": "lead" 51 | } 52 | ], 53 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 54 | "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 55 | "keywords": [ 56 | "phpcs", 57 | "standards" 58 | ], 59 | "time": "2019-04-10T23:49:02+00:00" 60 | } 61 | ], 62 | "aliases": [], 63 | "minimum-stability": "stable", 64 | "stability-flags": [], 65 | "prefer-stable": false, 66 | "prefer-lowest": false, 67 | "platform": { 68 | "php": ">=7.0" 69 | }, 70 | "platform-dev": [] 71 | } 72 | -------------------------------------------------------------------------------- /src/helpers.php: -------------------------------------------------------------------------------- 1 |