├── .gitignore ├── .vscodeignore ├── images └── icon.png ├── .vscode └── launch.json ├── LICENSE.md ├── vsc-extension-quickstart.md ├── package.json ├── README.md ├── CHANGELOG.md └── snippets └── php.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vsix 3 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | vsc-extension-quickstart.md 5 | -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyntwp/flynt-vscode-snippets/HEAD/images/icon.png -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-present bleech GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | * This folder contains all of the files necessary for your extension. 5 | * `package.json` - this is the manifest file that defines the location of the snippet file 6 | and specifies the language of the snippets. 7 | * `snippets/snippets.json` - the file containing all snippets. 8 | 9 | ## Get up and running straight away 10 | * Press `F5` to open a new window with your extension loaded. 11 | * Create a new file with a file name suffix matching your language. 12 | * Verify that your snippets are proposed on intellisense. 13 | 14 | ## Make changes 15 | * You can relaunch the extension from the debug toolbar after making changes to the files listed above. 16 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. 17 | 18 | ## Install your extension 19 | * To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. 20 | * To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flynt-vscode-snippets", 3 | "displayName": "Flynt Snippets", 4 | "description": "Snippets for development with the Flynt framework.", 5 | "version": "1.1.0", 6 | "publisher": "flyntwp", 7 | "license": "MIT", 8 | "bugs": { 9 | "url": "https://github.com/flyntwp/flynt-vscode-snippets/issues" 10 | }, 11 | "homepage": "https://github.com/flyntwp/flynt-vscode-snippets/", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/flyntwp/flynt-vscode-snippets/" 15 | }, 16 | "icon": "images/icon.png", 17 | "engines": { 18 | "vscode": "^1.19.0" 19 | }, 20 | "categories": [ 21 | "Snippets" 22 | ], 23 | "keywords": [ 24 | "Flynt" 25 | ], 26 | "contributes": { 27 | "snippets": [ 28 | { 29 | "language": "json", 30 | "path": "./snippets/json.json" 31 | }, 32 | { 33 | "language": "php", 34 | "path": "./snippets/php.json" 35 | }, 36 | { 37 | "language": "twig", 38 | "path": "./snippets/twig.json" 39 | }, 40 | { 41 | "language": "javascript", 42 | "path": "./snippets/javascript.json" 43 | } 44 | ] 45 | }, 46 | "scripts": { 47 | "release": "standard-version -a", 48 | "releaseGithub": "conventional-github-releaser -p angular" 49 | }, 50 | "devDependencies": { 51 | "conventional-github-releaser": "^3.1.2", 52 | "standard-version": "^5.0.2" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flynt Snippets (flynt-vscode-snippets) 2 | 3 | [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) 4 | 5 | Snippets for development with the Flynt framework. 6 | 7 | ## Table of Contents 8 | 9 | - [Flynt Snippets (flynt-vscode-snippets)](#flynt-snippets-flynt-vscode-snippets) 10 | - [Table of Contents](#table-of-contents) 11 | - [Background](#background) 12 | - [Install](#install) 13 | - [Usage](#usage) 14 | - [PHP](#php) 15 | - [Maintainers](#maintainers) 16 | - [Contribute](#contribute) 17 | - [License](#license) 18 | 19 | ## Background 20 | 21 | This extension provides a number of helpful [Visual Studio Code](https://code.visualstudio.com/) snippets for use with the [Flynt framework](https://flyntwp.com/). 22 | 23 | If you are looking for the old Flynt snippets (v0.x), please see the [legacy extension](https://marketplace.visualstudio.com/itemdetails?itemName=flyntwp.flynt-vscode-snippets-legacy) in the Visual Studio Code Marketplace. 24 | 25 | ## Install 26 | 27 | Install the extension from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/) or the extensions tab. 28 | 29 | ## Usage 30 | 31 | The extension adds snippets prefixed with `flynt` for the following language extensions: 32 | 33 | ### PHP 34 | - Commonly used code templates and scaffolding. 35 | - ACF field templates to be used in the `functions.php` file of a component. 36 | 37 | Start typing `flynt` in one of these languages to see a list of the available snippets. 38 | 39 | ## Maintainers 40 | 41 | This project is maintained by [bleech](https://github.com/bleech). 42 | 43 | The main people in charge of this repo are: 44 | 45 | - [Dominik Tränklein](https://github.com/domtra) 46 | - [Doğa Gürdal](https://github.com/Qakulukiam) 47 | 48 | ## Contribute 49 | 50 | To contribute, please use GitHub [issues](https://github.com/flyntwp/flynt-vscode-snippets/issues). Pull requests are accepted. Please also take a moment to read the [Contributing Guidelines](https://github.com/flyntwp/guidelines/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/flyntwp/guidelines/blob/master/CODE_OF_CONDUCT.md). 51 | 52 | If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification. 53 | 54 | ## License 55 | 56 | MIT © [bleech](https://www.bleech.de) 57 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | # [1.1.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v1.0.0...v1.1.0) (2020-09-11) 7 | 8 | 9 | ### Features 10 | 11 | * add snippets for DateTime, Time & Color pickers ([6d41041](https://github.com/flyntwp/flynt-vscode-snippets/commit/6d41041)) 12 | 13 | 14 | 15 | 16 | # [1.0.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.8.0...v1.0.0) (2019-04-11) 17 | 18 | 19 | ### Features 20 | 21 | * **snippets/php:** add new Flynt snippets for PHP ([#3](https://github.com/flyntwp/flynt-vscode-snippets/issues/3)) ([7cc8bd1](https://github.com/flyntwp/flynt-vscode-snippets/commit/7cc8bd1)) 22 | * **snippets/php:** add use statement to register fields snippets ([96305ef](https://github.com/flyntwp/flynt-vscode-snippets/commit/96305ef)) 23 | * **snippets/php:** update flyntComponentData snippet for new Flynt ([58d0b64](https://github.com/flyntwp/flynt-vscode-snippets/commit/58d0b64)) 24 | 25 | 26 | 27 | 28 | # [0.8.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.7.0...v0.8.0) (2018-08-28) 29 | 30 | 31 | ### Features 32 | 33 | * **snippets/php:** update component scaffolding and remove unused snippet ([#1](https://github.com/flyntwp/flynt-vscode-snippets/issues/1)) ([eaaf898](https://github.com/flyntwp/flynt-vscode-snippets/commit/eaaf898)) 34 | 35 | 36 | 37 | 38 | # [0.7.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.6.0...v0.7.0) (2018-07-13) 39 | 40 | 41 | ### Features 42 | 43 | * **snippets/javascript:** add file loader import snippet ([a9f2d47](https://github.com/flyntwp/flynt-vscode-snippets/commit/a9f2d47)) 44 | * **snippets/twig:** add twig area snippet ([63fc9bb](https://github.com/flyntwp/flynt-vscode-snippets/commit/63fc9bb)) 45 | 46 | 47 | 48 | 49 | # [0.6.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.5.0...v0.6.0) (2018-06-01) 50 | 51 | 52 | ### Bug Fixes 53 | 54 | * **snippets/json:** add missing name property to message field ([b7f62dd](https://github.com/flyntwp/flynt-vscode-snippets/commit/b7f62dd)) 55 | 56 | 57 | ### Features 58 | 59 | * **snippets/json:** add button group field ([23981a6](https://github.com/flyntwp/flynt-vscode-snippets/commit/23981a6)) 60 | 61 | 62 | 63 | 64 | # [0.5.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.4.0...v0.5.0) (2018-01-24) 65 | 66 | 67 | ### Features 68 | 69 | * **snippets/php:** add dynamic subcomponent snippet ([d0d235b](https://github.com/flyntwp/flynt-vscode-snippets/commit/d0d235b)) 70 | 71 | 72 | 73 | 74 | # [0.4.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.3.0...v0.4.0) (2018-01-15) 75 | 76 | 77 | ### Bug Fixes 78 | 79 | * **snippets/php:** use choice placeholder in component asset dependency snippet ([8264f79](https://github.com/flyntwp/flynt-vscode-snippets/commit/8264f79)) 80 | 81 | 82 | ### Features 83 | 84 | * **snippets/json:** add ACF conditional logic property snippet ([583a7f1](https://github.com/flyntwp/flynt-vscode-snippets/commit/583a7f1)) 85 | * **snippets/json:** add ACF group field snippet ([732ae32](https://github.com/flyntwp/flynt-vscode-snippets/commit/732ae32)) 86 | * **snippets/php:** add current directory name as Component name automatically ([b8a440d](https://github.com/flyntwp/flynt-vscode-snippets/commit/b8a440d)) 87 | 88 | 89 | 90 | 91 | # [0.3.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.2.1...v0.3.0) (2018-01-04) 92 | 93 | 94 | ### Bug Fixes 95 | 96 | * **snippets/json:** add default values for maxlength properties ([a08190f](https://github.com/flyntwp/flynt-vscode-snippets/commit/a08190f)) 97 | * **snippets/json:** add missing pipe ([c21db99](https://github.com/flyntwp/flynt-vscode-snippets/commit/c21db99)) 98 | * **snippets/json:** add missing pipes to choice in post object snippet ([8b17013](https://github.com/flyntwp/flynt-vscode-snippets/commit/8b17013)) 99 | * **snippets/json:** order ACF user snippet tabbing correctly ([a42864f](https://github.com/flyntwp/flynt-vscode-snippets/commit/a42864f)) 100 | * **snippets/json:** reorder ACF checkbox field snippet and set correct type ([607e811](https://github.com/flyntwp/flynt-vscode-snippets/commit/607e811)) 101 | * **snippets/json:** use choices option for appropriate snippets ([f7b5e40](https://github.com/flyntwp/flynt-vscode-snippets/commit/f7b5e40)) 102 | 103 | 104 | ### Features 105 | 106 | * **snippets/json:** add ACF accordion field snippet ([5d5a5dd](https://github.com/flyntwp/flynt-vscode-snippets/commit/5d5a5dd)) 107 | * **snippets/json:** add ACF link field snippet ([5f43e8d](https://github.com/flyntwp/flynt-vscode-snippets/commit/5f43e8d)) 108 | * **snippets/json:** add custom post type config snippet ([4bc780e](https://github.com/flyntwp/flynt-vscode-snippets/commit/4bc780e)) 109 | 110 | 111 | 112 | 113 | ## [0.2.1](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.2.0...v0.2.1) (2018-01-02) 114 | 115 | 116 | 117 | 118 | # [0.2.0](https://github.com/flyntwp/flynt-vscode-snippets/compare/v0.1.0...v0.2.0) (2018-01-02) 119 | 120 | 121 | ### Bug Fixes 122 | 123 | * **snippets/json:** add missing comma in WYSIWYG field snippet ([ef9c4a7](https://github.com/flyntwp/flynt-vscode-snippets/commit/ef9c4a7)) 124 | * **snippets/json:** add missing name property to flexible content snippet ([3ce0101](https://github.com/flyntwp/flynt-vscode-snippets/commit/3ce0101)) 125 | 126 | 127 | ### Features 128 | 129 | * **snippets/json:** add ui setting to true false field snippet ([3194b04](https://github.com/flyntwp/flynt-vscode-snippets/commit/3194b04)) 130 | 131 | 132 | 133 | 134 | # 0.1.0 (2018-01-02) 135 | 136 | initial release 137 | -------------------------------------------------------------------------------- /snippets/php.json: -------------------------------------------------------------------------------- 1 | { 2 | "Text Field": { 3 | "prefix": "flyntText", 4 | "body": [ 5 | "[", 6 | "\t'label' => '$1',", 7 | "\t'name' => '$2',", 8 | "\t'type' => 'text'", 9 | "]," 10 | ] 11 | }, 12 | "Text Area": { 13 | "prefix": "flyntTextarea", 14 | "body": [ 15 | "[", 16 | "\t'label' => '$1',", 17 | "\t'name' => '$2',", 18 | "\t'type' => 'textarea',", 19 | "\t'maxlength' => ${3:0},", 20 | "\t'rows' => ${4:8},", 21 | "\t'new_lines' => '${5|wpautop,br|}'", 22 | "]," 23 | ] 24 | }, 25 | "Number": { 26 | "prefix": "flyntNumber", 27 | "body": [ 28 | "[", 29 | "\t'label' => '$1',", 30 | "\t'name' => '$2',", 31 | "\t'type' => 'number',", 32 | "\t'min' => ${3:0},", 33 | "\t'max' => ${4:0},", 34 | "\t'step' => ${5:1}", 35 | "]," 36 | ] 37 | }, 38 | "Email": { 39 | "prefix": "flyntEmail", 40 | "body": [ 41 | "[", 42 | "\t'label' => '$1',", 43 | "\t'name' => '$2',", 44 | "\t'type' => 'email'", 45 | "]," 46 | ] 47 | }, 48 | "URL": { 49 | "prefix": "flyntURL", 50 | "body": [ 51 | "[", 52 | "\t'label' => '$1',", 53 | "\t'name' => '$2',", 54 | "\t'type' => 'url'", 55 | "]," 56 | ] 57 | }, 58 | "Password": { 59 | "prefix": "flyntPassword", 60 | "body": [ 61 | "[", 62 | "\t'label' => '$1',", 63 | "\t'name' => '$2',", 64 | "\t'type' => 'password'", 65 | "]," 66 | ] 67 | }, 68 | "WYSIWYG": { 69 | "prefix": "flyntWYSIWYG", 70 | "body": [ 71 | "[", 72 | "\t'label' => '$1',", 73 | "\t'name' => '$2',", 74 | "\t'type' => 'wysiwyg',", 75 | "\t'tabs' => '${3|visual\\,text,visual,text|}',", 76 | "\t'toolbar' => '${4|default,basic|}',", 77 | "\t'media_upload' => ${5|0,1|},", 78 | "\t'delay' => ${6|1,0|}", 79 | "]," 80 | ] 81 | }, 82 | "oEmbed": { 83 | "prefix": "flyntOEmbed", 84 | "body": [ 85 | "[", 86 | "\t'label' => '$1',", 87 | "\t'name' => '$2',", 88 | "\t'type' => 'oembed'", 89 | "]," 90 | ] 91 | }, 92 | "Image": { 93 | "prefix": "flyntImage", 94 | "body": [ 95 | "[", 96 | "\t'label' => '$1',", 97 | "\t'name' => '$2',", 98 | "\t'type' => 'image',", 99 | "\t'return_format' => '${3|array,url,id|}',", 100 | "\t'preview_size' => '${4|thumbnail,medium,large,full|}',", 101 | "\t'library' => '${5|all,uploadedTo|}',", 102 | "\t'min_width' => ${6:0},", 103 | "\t'max_width' => ${7:0},", 104 | "\t'min_height' => ${8:0},", 105 | "\t'max_height' => ${9:0},", 106 | "\t'min_size' => ${10:0},", 107 | "\t'max_size' => ${11:0},", 108 | "\t'mime_types' => '${12:jpg,jpeg}'", 109 | "]," 110 | ] 111 | }, 112 | "File": { 113 | "prefix": "flyntFile", 114 | "body": [ 115 | "[", 116 | "\t'label' => '$1',", 117 | "\t'name' => '$2',", 118 | "\t'type' => 'file',", 119 | "\t'return_format' => '${3|array,url,id|}',", 120 | "\t'library' => '${4|all,uploadedTo|}',", 121 | "\t'min_size' => ${5:0},", 122 | "\t'max_size' => ${6:0},", 123 | "\t'mime_types' => '${7:zip,pdf}'", 124 | "]," 125 | ] 126 | }, 127 | "Gallery": { 128 | "prefix": "flyntGallery", 129 | "body": [ 130 | "[", 131 | "\t'label' => '$1',", 132 | "\t'name' => '$2',", 133 | "\t'type' => 'gallery',", 134 | "\t'min' => ${3:0},", 135 | "\t'max' => ${4:0},", 136 | "\t'preview_size' => '${5|thumbnail,medium,large,full|}',", 137 | "\t'library' => '${6|all,uploadedTo|}',", 138 | "\t'min_width' => ${7:0},", 139 | "\t'max_width' => ${8:0},", 140 | "\t'min_height' => ${9:0},", 141 | "\t'max_height' => ${10:0},", 142 | "\t'min_size' => ${11:0},", 143 | "\t'max_size' => ${12:0},", 144 | "\t'mime_types' => '${13:jpg,jpeg}'", 145 | "]," 146 | ] 147 | }, 148 | "Select": { 149 | "prefix": "flyntSelect", 150 | "body": [ 151 | "[", 152 | "\t'label' => '$1',", 153 | "\t'name' => '$2',", 154 | "\t'type' => 'select',", 155 | "\t'allow_null' => ${3|0,1|},", 156 | "\t'multiple' => ${4|0,1|},", 157 | "\t'ui' => ${5|1,0|},", 158 | "\t'ajax' => ${6|0,1|},", 159 | "\t'choices' => [", 160 | "\t\t'$7' => $8", 161 | "\t],", 162 | "\t'default_value' => '${9:$7}'", 163 | "]," 164 | ] 165 | }, 166 | "Checkbox": { 167 | "prefix": "flyntCheckbox", 168 | "body": [ 169 | "[", 170 | "\t'label' => '$1',", 171 | "\t'name' => '$2',", 172 | "\t'type' => 'checkbox',", 173 | "\t'layout' => '${3|horizontal,vertical|}',", 174 | "\t'toggle' => ${4|0,1|},", 175 | "\t'choices' => [", 176 | "\t\t'$5' => '$6'", 177 | "\t],", 178 | "\t'default_value' => '${7:$5}'", 179 | "]," 180 | ] 181 | }, 182 | "TrueFalse": { 183 | "prefix": "flyntTrueFalse", 184 | "body": [ 185 | "[", 186 | "\t'label' => '$1',", 187 | "\t'name' => '$2',", 188 | "\t'type' => 'true_false',", 189 | "\t'default_value' => ${3|0,1|},", 190 | "\t'ui' => ${4|1,0|}", 191 | "]," 192 | ] 193 | }, 194 | "Radio": { 195 | "prefix": "flyntRadio", 196 | "body": [ 197 | "[", 198 | "\t'label' => '$1',", 199 | "\t'name' => '$2',", 200 | "\t'type' => 'radio',", 201 | "\t'other_choice' => ${3|0,1|},", 202 | "\t'save_other_choice' => ${4|0,1|},", 203 | "\t'layout' => '${5|horizontal,vertical|}',", 204 | "\t'choices' => [", 205 | "\t\t'$6' => '$7'", 206 | "\t],", 207 | "\t'default_value' => '${8:$6}'", 208 | "]," 209 | ] 210 | }, 211 | "User Role Selector": { 212 | "prefix": "flyntUserRoleSelector", 213 | "body": [ 214 | "[", 215 | "\t'label' => '$1',", 216 | "\t'name' => '$2',", 217 | "\t'type' => 'user_role_selector',", 218 | "\t'return_value' => '${3|object,name|}',", 219 | "\t'allowed_roles' => [", 220 | "\t\t'$4'", 221 | "\t],", 222 | "\t'field_type' => '${5|checkbox,multi_select,radio_buttons,select|}'", 223 | "]," 224 | ] 225 | }, 226 | "Post Object": { 227 | "prefix": "flyntPostObject", 228 | "body": [ 229 | "[", 230 | "\t'label' => '$1',", 231 | "\t'name' => '$2',", 232 | "\t'type' => 'post_object',", 233 | "\t'post_type' => [", 234 | "\t\t'$3'", 235 | "\t],", 236 | "\t'taxonomy' => [", 237 | "\t\t'$4'", 238 | "\t],", 239 | "\t'allow_null' => ${5|0,1|},", 240 | "\t'multiple' => ${6|0,1|},", 241 | "\t'return_format' => '${7|object,id|}',", 242 | "\t'ui' => ${8|1,0|}", 243 | "]," 244 | ] 245 | }, 246 | "Page Link": { 247 | "prefix": "flyntPageLink", 248 | "body": [ 249 | "[", 250 | "\t'label' => '$1',", 251 | "\t'name' => '$2',", 252 | "\t'type' => 'page_link',", 253 | "\t'post_type' => [", 254 | "\t\t'$3'", 255 | "\t],", 256 | "\t'taxonomy' => [", 257 | "\t\t'$4'", 258 | "\t],", 259 | "\t'allow_null' => ${5|0,1|},", 260 | "\t'multiple' => ${6|0,1|}", 261 | "]," 262 | ] 263 | }, 264 | "Relationship": { 265 | "prefix": "flyntRelationship", 266 | "body": [ 267 | "[", 268 | "\t'label' => '$1',", 269 | "\t'name' => '$2',", 270 | "\t'type' => 'relationship',", 271 | "\t'post_type' => [", 272 | "\t\t'$3'", 273 | "\t],", 274 | "\t'taxonomy' => [", 275 | "\t\t'$4'", 276 | "\t],", 277 | "\t'filters' => [", 278 | "\t\t'$5'", 279 | "\t],", 280 | "\t'elements' => [", 281 | "\t\t'$6'", 282 | "\t],", 283 | "\t'min' => ${7:0},", 284 | "\t'max' => ${8:0},", 285 | "\t'return_format' => '${9|object,id|}'", 286 | "]," 287 | ] 288 | }, 289 | "Taxonomy": { 290 | "prefix": "flyntTaxonomy", 291 | "body": [ 292 | "[", 293 | "\t'label' => '$1',", 294 | "\t'name' => '$2',", 295 | "\t'type' => 'taxonomy',", 296 | "\t'taxonomy' => '$3',", 297 | "\t'field_type' => '${4|checkbox,multi_select,radio_buttons,select|}',", 298 | "\t'allow_null' => ${5|0,1|},", 299 | "\t'multiple' => ${6|0,1|},", 300 | "\t'add_term' => ${7|0,1|},", 301 | "\t'save_terms' => ${8|0,1|},", 302 | "\t'load_terms' => ${9|0,1|},", 303 | "\t'return_format' => '${10|object,id|}'", 304 | "]," 305 | ] 306 | }, 307 | "User": { 308 | "prefix": "flyntUser", 309 | "body": [ 310 | "[", 311 | "\t'label' => '$1',", 312 | "\t'name' => '$2',", 313 | "\t'type' => 'user',", 314 | "\t'role' => [", 315 | "\t\t'$3'", 316 | "\t],", 317 | "\t'allow_null' => ${4|0,1|},", 318 | "\t'multiple' => ${5|0,1|}", 319 | "]," 320 | ] 321 | }, 322 | "Google Map": { 323 | "prefix": "flyntGoogleMap", 324 | "body": [ 325 | "[", 326 | "\t'label' => '$1',", 327 | "\t'name' => '$2',", 328 | "\t'type' => 'google_map',", 329 | "\t'center_lat' => ${3:0},", 330 | "\t'center_lng' => ${4:0},", 331 | "\t'zoom' => ${5:14},", 332 | "\t'height' => ${6:400}", 333 | "]," 334 | ] 335 | }, 336 | "Date Picker": { 337 | "prefix": "flyntDatePicker", 338 | "body": [ 339 | "[", 340 | "\t'label' => '$1',", 341 | "\t'name' => '$2',", 342 | "\t'type' => 'date_picker',", 343 | "\t'display_format' => '${3:d.m.Y}',", 344 | "\t'return_format' => '${4:Y-m-d}',", 345 | "\t'first_day' => ${5|1,0,2,3,4,5,6|}", 346 | "]," 347 | ] 348 | }, 349 | "Date Time Picker": { 350 | "prefix": "flyntDateTimePicker", 351 | "body": [ 352 | "[", 353 | "\t'label' => '$1',", 354 | "\t'name' => '$2',", 355 | "\t'type' => 'date_time_picker',", 356 | "\t'time_format' => '${3:h:mm tt}',", 357 | "\t'show_date' => '${4|true, false|}',", 358 | "\t'display_format' => '${5:m/d/y}',", 359 | "\t'return_format' => '${6:m/d/y}',", 360 | "\t'show_week_number' => '${7|true, false|},", 361 | "\t'picker' => 'slider',", 362 | "\t'save_as_timestamp' => '${8|true, false|}',", 363 | "\t'get_as_timestamp' => '${9|true, false|}',", 364 | "]," 365 | ] 366 | }, 367 | "Time Picker": { 368 | "prefix": "flyntTimePicker", 369 | "body": [ 370 | "[", 371 | "\t'label' => '$1',", 372 | "\t'name' => '$2',", 373 | "\t'type' => 'time_picker',", 374 | "\t'display_format' => '${3:g:i a}',", 375 | "\t'return_format' => '${4:g:i a}',", 376 | "]," 377 | ] 378 | }, 379 | "Color Picker": { 380 | "prefix": "flyntColorPicker", 381 | "body": [ 382 | "[", 383 | "\t'label' => '$1',", 384 | "\t'name' => '$2',", 385 | "\t'type' => 'color_picker',", 386 | "\t'default_value' => '${3:#ffffff}',", 387 | "]," 388 | ] 389 | }, 390 | "Message": { 391 | "prefix": "flyntMessage", 392 | "body": [ 393 | "[", 394 | "\t'label' => '$1',", 395 | "\t'name' => '$2',", 396 | "\t'type' => 'message',", 397 | "\t'message' => '$3',", 398 | "\t'new_lines' => '${4|wpautop,br|}',", 399 | "\t'esc_html' => ${5|1,0|}", 400 | "]," 401 | ] 402 | }, 403 | "Tab": { 404 | "prefix": "flyntTab", 405 | "body": [ 406 | "[", 407 | "\t'label' => '$1',", 408 | "\t'name' => '$2',", 409 | "\t'type' => 'tab',", 410 | "\t'placement' => '${3|top,bottom,left,right|}',", 411 | "\t'endpoint' => ${4|0,1|}", 412 | "]," 413 | ] 414 | }, 415 | "Repeater": { 416 | "prefix": "flyntRepeater", 417 | "body": [ 418 | "[", 419 | "\t'label' => '$1',", 420 | "\t'name' => '$2',", 421 | "\t'type' => 'repeater',", 422 | "\t'collapsed' => '$3',", 423 | "\t'min' => ${4:0},", 424 | "\t'max' => ${5:0},", 425 | "\t'layout' => '${6|table,block,row|}',", 426 | "\t'button_label' => 'Add ${7:Item}',", 427 | "\t'sub_fields' => [", 428 | "\t\t$8", 429 | "\t]", 430 | "]," 431 | ] 432 | }, 433 | "Flexible Content": { 434 | "prefix": "flyntFlexibleContent", 435 | "body": [ 436 | "[", 437 | "\t'label' => '$1',", 438 | "\t'name' => '$2',", 439 | "\t'type' => 'flexible_content',", 440 | "\t'button_label' => 'Add ${3:Component}',", 441 | "\t'min' => ${4:0},", 442 | "\t'max' => ${5:0},", 443 | "\t'layouts' => [", 444 | "\t\t$6", 445 | "\t]", 446 | "]," 447 | ] 448 | }, 449 | "Link": { 450 | "prefix": "flyntLink", 451 | "body": [ 452 | "[", 453 | "\t'label' => '$1',", 454 | "\t'name' => '$2',", 455 | "\t'type' => 'link',", 456 | "\t'return_format' => '${3|array,url|}'", 457 | "]," 458 | ] 459 | }, 460 | "Group": { 461 | "prefix": "flyntGroup", 462 | "body": [ 463 | "[", 464 | "\t'label' => '$1',", 465 | "\t'name' => '$2',", 466 | "\t'type' => 'group',", 467 | "\t'sub_fields' => [", 468 | "\t\t$3", 469 | "\t]", 470 | "]," 471 | ] 472 | }, 473 | "Accordion": { 474 | "prefix": "flyntAccordion", 475 | "body": [ 476 | "[", 477 | "\t'label' => '$1',", 478 | "\t'name' => '$2',", 479 | "\t'type' => 'accordion',", 480 | "\t'open' => ${3|0,1|},", 481 | "\t'multi_expand' => ${4|1,0|},", 482 | "\t'endpoint' => ${5|0,1|}", 483 | "]," 484 | ] 485 | }, 486 | "Button Group": { 487 | "prefix": "flyntButtonGroup", 488 | "body": [ 489 | "[", 490 | "\t'label' => '$1',", 491 | "\t'name' => '$2',", 492 | "\t'type' => 'button_group',", 493 | "\t'choices' => [", 494 | "\t\t'$3' => '$4'", 495 | "\t],", 496 | "\t'default_value' => '${5:$3}'", 497 | "]," 498 | ] 499 | }, 500 | "Conditional Logic": { 501 | "prefix": "flyntConditionalLogic", 502 | "body": [ 503 | "'conditional_logic' => [", 504 | "\t[", 505 | "\t\t[", 506 | "\t\t\t'fieldPath' => '$1',", 507 | "\t\t\t'operator' => '${2|==,!=|}',", 508 | "\t\t\t'value' => '$3'", 509 | "\t\t]", 510 | "\t]", 511 | "]," 512 | ] 513 | }, 514 | "Register Fields": { 515 | "prefix": "flyntRegisterFields", 516 | "body": [ 517 | "use Flynt\\Api;", 518 | "", 519 | "Api::registerFields('${1:${TM_DIRECTORY/.*\\/(.+)$/${1:/capitalize}/}}', [", 520 | "\t'layout' => [", 521 | "\t\t'name' => '$2',", 522 | "\t\t'label' => '$3',", 523 | "\t\t'sub_fields' => [", 524 | "\t\t\t$4", 525 | "\t\t]", 526 | "\t]", 527 | "]);" 528 | ] 529 | }, 530 | "Add Translatable Options": { 531 | "prefix": "flyntTranslatableOption", 532 | "body": [ 533 | "Options::addTranslatable('${1:${TM_DIRECTORY/.*\\/(.+)$/${1:/capitalize}/}}', [", 534 | "\t$2", 535 | "]);" 536 | ] 537 | }, 538 | "Add Global Options": { 539 | "prefix": "flyntGlobalOption", 540 | "body": [ 541 | "Options::addGlobal('${1:${TM_DIRECTORY/.*\\/(.+)$/${1:/capitalize}/}}', [", 542 | "\t$2", 543 | "]);" 544 | ] 545 | }, 546 | "Add Component Data": { 547 | "prefix": "flyntComponentData", 548 | "body": [ 549 | "add_filter('Flynt/addComponentData?name=${1:${TM_DIRECTORY/.*\\/(.+)$/${1:/capitalize}/}}', function (\\$data${2:, \\$componentName}) {", 550 | "\t$4", 551 | "", 552 | "\treturn \\$data;", 553 | "}${3:, 10, 2});" 554 | ] 555 | } 556 | } 557 | --------------------------------------------------------------------------------