├── .gitignore ├── .vscodeignore ├── images ├── demo.gif └── icon.png ├── .editorconfig ├── .vscode └── launch.json ├── CHANGELOG.md ├── README.md ├── package.json ├── snippets ├── constants.json └── functions.json └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vsix 3 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | -------------------------------------------------------------------------------- /images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/claudiosanches/vscode-woocommerce/HEAD/images/demo.gif -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/claudiosanches/vscode-woocommerce/HEAD/images/icon.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [*.json] 10 | indent_style = space 11 | indent_size = 4 12 | insert_final_newline = false 13 | -------------------------------------------------------------------------------- /.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 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 | 7 | ## [1.1.0] - 2019-01-22 8 | ### Added 9 | - WooCommerce 3.5 functions, actions, filters and constants. 10 | 11 | ## [1.0.0] - 2017-11-24 12 | ### Added 13 | - WooCommerce 3.2 functions, actions, filters and constants. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WooCommerce - Snippets & autocomplete 2 | 3 | This extension for Visual Studio Code adds [WooCommerce](https://wordpress.org/woocommerce) snippets and autocompletion of functions, classes and hooks. 4 | 5 | ![Demo](images/demo.gif) 6 | 7 | ## Features 8 | 9 | Autocomplete for: 10 | 11 | WooCommerce version: 3.2 12 | 13 | Functions : 522 14 | Actions : 496 15 | Filters : 496 16 | Constants : 22 17 | 18 | ## License 19 | 20 | [GPLv3](https://raw.githubusercontent.com/claudiosanches/vscode-woocommerce/master/LICENSE) 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "woocommerce", 3 | "displayName": "WooCommerce - Snippets & autocomplete", 4 | "description": "A collection of WooCommerce snippets and autocompletions.", 5 | "version": "1.1.0", 6 | "publisher": "claudiosanches", 7 | "author": { 8 | "name": "Claudio Sanches" 9 | }, 10 | "license": "GPLv3", 11 | "homepage": "https://github.com/claudiosanches/vscode-woocommerce", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/claudiosanches/vscode-woocommerce" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/claudiosanches/vscode-woocommerce/issues" 18 | }, 19 | "icon": "images/icon.png", 20 | "engines": { 21 | "vscode": "^1.18.0" 22 | }, 23 | "keywords": [ 24 | "php", 25 | "wordpress", 26 | "woocommerce" 27 | ], 28 | "categories": [ 29 | "Snippets" 30 | ], 31 | "contributes": { 32 | "snippets": [ 33 | { 34 | "language": "php", 35 | "path": "./snippets/functions.json" 36 | }, 37 | { 38 | "language": "php", 39 | "path": "./snippets/actions.json" 40 | }, 41 | { 42 | "language": "php", 43 | "path": "./snippets/filters.json" 44 | }, 45 | { 46 | "language": "php", 47 | "path": "./snippets/constants.json" 48 | } 49 | ] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /snippets/constants.json: -------------------------------------------------------------------------------- 1 | { 2 | "WC_PLUGIN_FILE": { 3 | "prefix": "WC_PLUGIN_FILE", 4 | "body": "WC_PLUGIN_FILE", 5 | "description": "Constant: WC_PLUGIN_FILE" 6 | }, 7 | "WC_DOING_AJAX": { 8 | "prefix": "WC_DOING_AJAX", 9 | "body": "WC_DOING_AJAX", 10 | "description": "Constant: WC_DOING_AJAX" 11 | }, 12 | "WOOCOMMERCE_CART": { 13 | "prefix": "WOOCOMMERCE_CART", 14 | "body": "WOOCOMMERCE_CART", 15 | "description": "Constant: WOOCOMMERCE_CART" 16 | }, 17 | "WOOCOMMERCE_CHECKOUT": { 18 | "prefix": "WOOCOMMERCE_CHECKOUT", 19 | "body": "WOOCOMMERCE_CHECKOUT", 20 | "description": "Constant: WOOCOMMERCE_CHECKOUT" 21 | }, 22 | "WC_MAX_LINKED_VARIATIONS": { 23 | "prefix": "WC_MAX_LINKED_VARIATIONS", 24 | "body": "WC_MAX_LINKED_VARIATIONS", 25 | "description": "Constant: WC_MAX_LINKED_VARIATIONS" 26 | }, 27 | "WC_UPDATING": { 28 | "prefix": "WC_UPDATING", 29 | "body": "WC_UPDATING", 30 | "description": "Constant: WC_UPDATING" 31 | }, 32 | "WC_CHUNK_SIZE": { 33 | "prefix": "WC_CHUNK_SIZE", 34 | "body": "WC_CHUNK_SIZE", 35 | "description": "Constant: WC_CHUNK_SIZE" 36 | }, 37 | "WC_INSTALLING": { 38 | "prefix": "WC_INSTALLING", 39 | "body": "WC_INSTALLING", 40 | "description": "Constant: WC_INSTALLING" 41 | }, 42 | "WC_ABSPATH": { 43 | "prefix": "WC_ABSPATH", 44 | "body": "WC_ABSPATH", 45 | "description": "Constant: WC_ABSPATH" 46 | }, 47 | "WC_PLUGIN_BASENAME": { 48 | "prefix": "WC_PLUGIN_BASENAME", 49 | "body": "WC_PLUGIN_BASENAME", 50 | "description": "Constant: WC_PLUGIN_BASENAME" 51 | }, 52 | "WC_VERSION": { 53 | "prefix": "WC_VERSION", 54 | "body": "WC_VERSION", 55 | "description": "Constant: WC_VERSION" 56 | }, 57 | "WOOCOMMERCE_VERSION": { 58 | "prefix": "WOOCOMMERCE_VERSION", 59 | "body": "WOOCOMMERCE_VERSION", 60 | "description": "Constant: WOOCOMMERCE_VERSION" 61 | }, 62 | "WC_ROUNDING_PRECISION": { 63 | "prefix": "WC_ROUNDING_PRECISION", 64 | "body": "WC_ROUNDING_PRECISION", 65 | "description": "Constant: WC_ROUNDING_PRECISION" 66 | }, 67 | "WC_DISCOUNT_ROUNDING_MODE": { 68 | "prefix": "WC_DISCOUNT_ROUNDING_MODE", 69 | "body": "WC_DISCOUNT_ROUNDING_MODE", 70 | "description": "Constant: WC_DISCOUNT_ROUNDING_MODE" 71 | }, 72 | "WC_TAX_ROUNDING_MODE": { 73 | "prefix": "WC_TAX_ROUNDING_MODE", 74 | "body": "WC_TAX_ROUNDING_MODE", 75 | "description": "Constant: WC_TAX_ROUNDING_MODE" 76 | }, 77 | "WC_DELIMITER": { 78 | "prefix": "WC_DELIMITER", 79 | "body": "WC_DELIMITER", 80 | "description": "Constant: WC_DELIMITER" 81 | }, 82 | "WC_LOG_DIR": { 83 | "prefix": "WC_LOG_DIR", 84 | "body": "WC_LOG_DIR", 85 | "description": "Constant: WC_LOG_DIR" 86 | }, 87 | "WC_SESSION_CACHE_GROUP": { 88 | "prefix": "WC_SESSION_CACHE_GROUP", 89 | "body": "WC_SESSION_CACHE_GROUP", 90 | "description": "Constant: WC_SESSION_CACHE_GROUP" 91 | }, 92 | "WC_TEMPLATE_DEBUG_MODE": { 93 | "prefix": "WC_TEMPLATE_DEBUG_MODE", 94 | "body": "WC_TEMPLATE_DEBUG_MODE", 95 | "description": "Constant: WC_TEMPLATE_DEBUG_MODE" 96 | }, 97 | "WC_TEMPLATE_PATH": { 98 | "prefix": "WC_TEMPLATE_PATH", 99 | "body": "WC_TEMPLATE_PATH", 100 | "description": "Constant: WC_TEMPLATE_PATH" 101 | }, 102 | "WC_USE_TRANSACTIONS": { 103 | "prefix": "WC_USE_TRANSACTIONS", 104 | "body": "WC_USE_TRANSACTIONS", 105 | "description": "Constant: WC_USE_TRANSACTIONS" 106 | } 107 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /snippets/functions.json: -------------------------------------------------------------------------------- 1 | { 2 | "wc": { 3 | "prefix": "wc", 4 | "body": "wc()", 5 | "description": "Main instance of WooCommerce." 6 | }, 7 | "wc_lostpassword_url": { 8 | "prefix": "wc_lostpassword_url", 9 | "body": "wc_lostpassword_url( ${1:default_url} )", 10 | "description": "Returns the url to the lost password endpoint url." 11 | }, 12 | "wc_customer_edit_account_url": { 13 | "prefix": "wc_customer_edit_account_url", 14 | "body": "wc_customer_edit_account_url()", 15 | "description": "Get the link to the edit account details page." 16 | }, 17 | "wc_edit_address_i18n": { 18 | "prefix": "wc_edit_address_i18n", 19 | "body": "wc_edit_address_i18n( ${1:id}${2:, ${3:flip}} )", 20 | "description": "Get the edit address slug translation." 21 | }, 22 | "wc_get_account_menu_items": { 23 | "prefix": "wc_get_account_menu_items", 24 | "body": "wc_get_account_menu_items()", 25 | "description": "Get My Account menu items." 26 | }, 27 | "wc_get_account_menu_item_classes": { 28 | "prefix": "wc_get_account_menu_item_classes", 29 | "body": "wc_get_account_menu_item_classes( ${1:endpoint} )", 30 | "description": "Get account menu item classes." 31 | }, 32 | "wc_get_account_endpoint_url": { 33 | "prefix": "wc_get_account_endpoint_url", 34 | "body": "wc_get_account_endpoint_url( ${1:endpoint} )", 35 | "description": "Get account endpoint URL." 36 | }, 37 | "wc_get_account_orders_columns": { 38 | "prefix": "wc_get_account_orders_columns", 39 | "body": "wc_get_account_orders_columns()", 40 | "description": "Get My Account > Orders columns." 41 | }, 42 | "wc_get_account_downloads_columns": { 43 | "prefix": "wc_get_account_downloads_columns", 44 | "body": "wc_get_account_downloads_columns()", 45 | "description": "Get My Account > Downloads columns." 46 | }, 47 | "wc_get_account_payment_methods_columns": { 48 | "prefix": "wc_get_account_payment_methods_columns", 49 | "body": "wc_get_account_payment_methods_columns()", 50 | "description": "Get My Account > Payment methods columns." 51 | }, 52 | "wc_get_account_payment_methods_types": { 53 | "prefix": "wc_get_account_payment_methods_types", 54 | "body": "wc_get_account_payment_methods_types()", 55 | "description": "Get My Account > Payment methods types" 56 | }, 57 | "wc_get_account_orders_actions": { 58 | "prefix": "wc_get_account_orders_actions", 59 | "body": "wc_get_account_orders_actions( ${1:order} )", 60 | "description": "Get account orders actions." 61 | }, 62 | "wc_get_account_formatted_address": { 63 | "prefix": "wc_get_account_formatted_address", 64 | "body": "wc_get_account_formatted_address( ${1:${2:address_type}${3:, ${4:customer_id}}} )", 65 | "description": "Get account formatted address." 66 | }, 67 | "wc_get_account_saved_payment_methods_list": { 68 | "prefix": "wc_get_account_saved_payment_methods_list", 69 | "body": "wc_get_account_saved_payment_methods_list( ${1:list}, ${2:customer_id} )", 70 | "description": "Returns an array of a user's saved payments list for output on the account tab." 71 | }, 72 | "wc_get_account_saved_payment_methods_list_item_cc": { 73 | "prefix": "wc_get_account_saved_payment_methods_list_item_cc", 74 | "body": "wc_get_account_saved_payment_methods_list_item_cc( ${1:item}, ${2:payment_token} )", 75 | "description": "Controls the output for credit cards on the my account page." 76 | }, 77 | "wc_get_account_saved_payment_methods_list_item_echeck": { 78 | "prefix": "wc_get_account_saved_payment_methods_list_item_echeck", 79 | "body": "wc_get_account_saved_payment_methods_list_item_echeck( ${1:item}, ${2:payment_token} )", 80 | "description": "Controls the output for eChecks on the my account page." 81 | }, 82 | "wc_get_text_attributes": { 83 | "prefix": "wc_get_text_attributes", 84 | "body": "wc_get_text_attributes( ${1:raw_attributes} )", 85 | "description": "Gets text attributes from a string." 86 | }, 87 | "wc_get_text_attributes_filter_callback": { 88 | "prefix": "wc_get_text_attributes_filter_callback", 89 | "body": "wc_get_text_attributes_filter_callback( ${1:value} )", 90 | "description": "See if an attribute is actually valid." 91 | }, 92 | "wc_implode_text_attributes": { 93 | "prefix": "wc_implode_text_attributes", 94 | "body": "wc_implode_text_attributes( ${1:attributes} )", 95 | "description": "Implode an array of attributes using WC_DELIMITER." 96 | }, 97 | "wc_get_attribute_taxonomies": { 98 | "prefix": "wc_get_attribute_taxonomies", 99 | "body": "wc_get_attribute_taxonomies()", 100 | "description": "Get attribute taxonomies." 101 | }, 102 | "wc_attribute_taxonomy_name": { 103 | "prefix": "wc_attribute_taxonomy_name", 104 | "body": "wc_attribute_taxonomy_name( ${1:attribute_name} )", 105 | "description": "Get a product attribute name." 106 | }, 107 | "wc_variation_attribute_name": { 108 | "prefix": "wc_variation_attribute_name", 109 | "body": "wc_variation_attribute_name( ${1:attribute_name} )", 110 | "description": "Get the attribute name used when storing values in post meta." 111 | }, 112 | "wc_attribute_taxonomy_name_by_id": { 113 | "prefix": "wc_attribute_taxonomy_name_by_id", 114 | "body": "wc_attribute_taxonomy_name_by_id( ${1:attribute_id} )", 115 | "description": "Get a product attribute name by ID." 116 | }, 117 | "wc_attribute_taxonomy_id_by_name": { 118 | "prefix": "wc_attribute_taxonomy_id_by_name", 119 | "body": "wc_attribute_taxonomy_id_by_name( ${1:name} )", 120 | "description": "Get a product attribute ID by name." 121 | }, 122 | "wc_attribute_label": { 123 | "prefix": "wc_attribute_label", 124 | "body": "wc_attribute_label( ${1:name}${2:, ${3:product}} )", 125 | "description": "Get a product attributes label." 126 | }, 127 | "wc_attribute_orderby": { 128 | "prefix": "wc_attribute_orderby", 129 | "body": "wc_attribute_orderby( ${1:name} )", 130 | "description": "Get a product attributes orderby setting." 131 | }, 132 | "wc_get_attribute_taxonomy_names": { 133 | "prefix": "wc_get_attribute_taxonomy_names", 134 | "body": "wc_get_attribute_taxonomy_names()", 135 | "description": "Get an array of product attribute taxonomies." 136 | }, 137 | "wc_get_attribute_types": { 138 | "prefix": "wc_get_attribute_types", 139 | "body": "wc_get_attribute_types()", 140 | "description": "Get attribute types." 141 | }, 142 | "wc_has_custom_attribute_types": { 143 | "prefix": "wc_has_custom_attribute_types", 144 | "body": "wc_has_custom_attribute_types()", 145 | "description": "Check if there are custom attribute types." 146 | }, 147 | "wc_get_attribute_type_label": { 148 | "prefix": "wc_get_attribute_type_label", 149 | "body": "wc_get_attribute_type_label( ${1:type} )", 150 | "description": "Get attribute type label." 151 | }, 152 | "wc_check_if_attribute_name_is_reserved": { 153 | "prefix": "wc_check_if_attribute_name_is_reserved", 154 | "body": "wc_check_if_attribute_name_is_reserved( ${1:attribute_name} )", 155 | "description": "Check if attribute name is reserved." 156 | }, 157 | "wc_attributes_array_filter_visible": { 158 | "prefix": "wc_attributes_array_filter_visible", 159 | "body": "wc_attributes_array_filter_visible( ${1:attribute} )", 160 | "description": "Callback for array filter to get visible only." 161 | }, 162 | "wc_attributes_array_filter_variation": { 163 | "prefix": "wc_attributes_array_filter_variation", 164 | "body": "wc_attributes_array_filter_variation( ${1:attribute} )", 165 | "description": "Callback for array filter to get variation attributes only." 166 | }, 167 | "wc_is_attribute_in_product_name": { 168 | "prefix": "wc_is_attribute_in_product_name", 169 | "body": "wc_is_attribute_in_product_name( ${1:attribute}, ${2:name} )", 170 | "description": "Check if an attribute is included in the attributes area of a variation name." 171 | }, 172 | "wc_array_filter_default_attributes": { 173 | "prefix": "wc_array_filter_default_attributes", 174 | "body": "wc_array_filter_default_attributes( ${1:attribute} )", 175 | "description": "Callback for array filter to get default attributes. Will allow for '0' string values, but regard all other" 176 | }, 177 | "wc_get_attribute": { 178 | "prefix": "wc_get_attribute", 179 | "body": "wc_get_attribute( ${1:id} )", 180 | "description": "Get attribute data by ID." 181 | }, 182 | "wc_create_attribute": { 183 | "prefix": "wc_create_attribute", 184 | "body": "wc_create_attribute( ${1:args} )", 185 | "description": "Create attribute." 186 | }, 187 | "wc_update_attribute": { 188 | "prefix": "wc_update_attribute", 189 | "body": "wc_update_attribute( ${1:id}, ${2:args} )", 190 | "description": "Update an attribute." 191 | }, 192 | "wc_delete_attribute": { 193 | "prefix": "wc_delete_attribute", 194 | "body": "wc_delete_attribute( ${1:id} )", 195 | "description": "Delete attribute by ID." 196 | }, 197 | "wc_protected_product_add_to_cart": { 198 | "prefix": "wc_protected_product_add_to_cart", 199 | "body": "wc_protected_product_add_to_cart( ${1:passed}, ${2:product_id} )", 200 | "description": "Prevent password protected products being added to the cart." 201 | }, 202 | "wc_empty_cart": { 203 | "prefix": "wc_empty_cart", 204 | "body": "wc_empty_cart()", 205 | "description": "Clears the cart session when called." 206 | }, 207 | "wc_load_persistent_cart": { 208 | "prefix": "wc_load_persistent_cart", 209 | "body": "wc_load_persistent_cart( ${1:user_login}, ${2:user} )", 210 | "description": "Load the persistent cart." 211 | }, 212 | "wc_get_raw_referer": { 213 | "prefix": "wc_get_raw_referer", 214 | "body": "wc_get_raw_referer()", 215 | "description": "Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer." 216 | }, 217 | "wc_add_to_cart_message": { 218 | "prefix": "wc_add_to_cart_message", 219 | "body": "wc_add_to_cart_message( ${1:products}${2:, ${3:show_qty}${4:, ${5:return}}} )", 220 | "description": "Add to cart messages." 221 | }, 222 | "wc_format_list_of_items": { 223 | "prefix": "wc_format_list_of_items", 224 | "body": "wc_format_list_of_items( ${1:items} )", 225 | "description": "Comma separate a list of item names, and replace final comma with 'and'." 226 | }, 227 | "wc_clear_cart_after_payment": { 228 | "prefix": "wc_clear_cart_after_payment", 229 | "body": "wc_clear_cart_after_payment()", 230 | "description": "Clear cart after payment." 231 | }, 232 | "wc_cart_totals_subtotal_html": { 233 | "prefix": "wc_cart_totals_subtotal_html", 234 | "body": "wc_cart_totals_subtotal_html()", 235 | "description": "Get the subtotal." 236 | }, 237 | "wc_cart_totals_shipping_html": { 238 | "prefix": "wc_cart_totals_shipping_html", 239 | "body": "wc_cart_totals_shipping_html()", 240 | "description": "Get shipping methods." 241 | }, 242 | "wc_cart_totals_taxes_total_html": { 243 | "prefix": "wc_cart_totals_taxes_total_html", 244 | "body": "wc_cart_totals_taxes_total_html()", 245 | "description": "Get taxes total." 246 | }, 247 | "wc_cart_totals_coupon_label": { 248 | "prefix": "wc_cart_totals_coupon_label", 249 | "body": "wc_cart_totals_coupon_label( ${1:coupon}${2:, ${3:echo}} )", 250 | "description": "Get a coupon label." 251 | }, 252 | "wc_cart_totals_coupon_html": { 253 | "prefix": "wc_cart_totals_coupon_html", 254 | "body": "wc_cart_totals_coupon_html( ${1:coupon} )", 255 | "description": "Get coupon display HTML." 256 | }, 257 | "wc_cart_totals_order_total_html": { 258 | "prefix": "wc_cart_totals_order_total_html", 259 | "body": "wc_cart_totals_order_total_html()", 260 | "description": "Get order total html including inc tax if needed." 261 | }, 262 | "wc_cart_totals_fee_html": { 263 | "prefix": "wc_cart_totals_fee_html", 264 | "body": "wc_cart_totals_fee_html( ${1:fee} )", 265 | "description": "Get the fee value." 266 | }, 267 | "wc_cart_totals_shipping_method_label": { 268 | "prefix": "wc_cart_totals_shipping_method_label", 269 | "body": "wc_cart_totals_shipping_method_label( ${1:method} )", 270 | "description": "Get a shipping methods full label including price." 271 | }, 272 | "wc_cart_round_discount": { 273 | "prefix": "wc_cart_round_discount", 274 | "body": "wc_cart_round_discount( ${1:value}, ${2:precision} )", 275 | "description": "Round discount." 276 | }, 277 | "wc_get_chosen_shipping_method_ids": { 278 | "prefix": "wc_get_chosen_shipping_method_ids", 279 | "body": "wc_get_chosen_shipping_method_ids()", 280 | "description": "Gets chosen shipping method IDs from chosen_shipping_methods session, without instance IDs." 281 | }, 282 | "wc_get_chosen_shipping_method_for_package": { 283 | "prefix": "wc_get_chosen_shipping_method_for_package", 284 | "body": "wc_get_chosen_shipping_method_for_package( ${1:key}, ${2:package} )", 285 | "description": "Get chosen method for package from session." 286 | }, 287 | "wc_get_default_shipping_method_for_package": { 288 | "prefix": "wc_get_default_shipping_method_for_package", 289 | "body": "wc_get_default_shipping_method_for_package( ${1:key}, ${2:package}, ${3:chosen_method} )", 290 | "description": "Choose the default method for a package." 291 | }, 292 | "wc_shipping_methods_have_changed": { 293 | "prefix": "wc_shipping_methods_have_changed", 294 | "body": "wc_shipping_methods_have_changed( ${1:key}, ${2:package} )", 295 | "description": "See if the methods have changed since the last request." 296 | }, 297 | "wc_get_cart_item_data_hash": { 298 | "prefix": "wc_get_cart_item_data_hash", 299 | "body": "wc_get_cart_item_data_hash( ${1:product} )", 300 | "description": "Gets a hash of important product data that when changed should cause cart items to be invalidated." 301 | }, 302 | "is_woocommerce": { 303 | "prefix": "is_woocommerce", 304 | "body": "is_woocommerce()", 305 | "description": "Is_woocommerce - Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included)." 306 | }, 307 | "is_shop": { 308 | "prefix": "is_shop", 309 | "body": "is_shop()", 310 | "description": "Is_shop - Returns true when viewing the product type archive (shop)." 311 | }, 312 | "is_product_taxonomy": { 313 | "prefix": "is_product_taxonomy", 314 | "body": "is_product_taxonomy()", 315 | "description": "Is_product_taxonomy - Returns true when viewing a product taxonomy archive." 316 | }, 317 | "is_product_category": { 318 | "prefix": "is_product_category", 319 | "body": "is_product_category( ${1:term} )", 320 | "description": "Is_product_category - Returns true when viewing a product category." 321 | }, 322 | "is_product_tag": { 323 | "prefix": "is_product_tag", 324 | "body": "is_product_tag( ${1:term} )", 325 | "description": "Is_product_tag - Returns true when viewing a product tag." 326 | }, 327 | "is_product": { 328 | "prefix": "is_product", 329 | "body": "is_product()", 330 | "description": "Is_product - Returns true when viewing a single product." 331 | }, 332 | "is_cart": { 333 | "prefix": "is_cart", 334 | "body": "is_cart()", 335 | "description": "Is_cart - Returns true when viewing the cart page." 336 | }, 337 | "is_checkout": { 338 | "prefix": "is_checkout", 339 | "body": "is_checkout()", 340 | "description": "Is_checkout - Returns true when viewing the checkout page." 341 | }, 342 | "is_checkout_pay_page": { 343 | "prefix": "is_checkout_pay_page", 344 | "body": "is_checkout_pay_page()", 345 | "description": "Is_checkout_pay - Returns true when viewing the checkout's pay page." 346 | }, 347 | "is_wc_endpoint_url": { 348 | "prefix": "is_wc_endpoint_url", 349 | "body": "is_wc_endpoint_url( ${1:endpoint} )", 350 | "description": "Is_wc_endpoint_url - Check if an endpoint is showing." 351 | }, 352 | "is_account_page": { 353 | "prefix": "is_account_page", 354 | "body": "is_account_page()", 355 | "description": "Is_account_page - Returns true when viewing an account page." 356 | }, 357 | "is_view_order_page": { 358 | "prefix": "is_view_order_page", 359 | "body": "is_view_order_page()", 360 | "description": "Is_view_order_page - Returns true when on the view order page." 361 | }, 362 | "is_edit_account_page": { 363 | "prefix": "is_edit_account_page", 364 | "body": "is_edit_account_page()", 365 | "description": "Check for edit account page." 366 | }, 367 | "is_order_received_page": { 368 | "prefix": "is_order_received_page", 369 | "body": "is_order_received_page()", 370 | "description": "Is_order_received_page - Returns true when viewing the order received page." 371 | }, 372 | "is_add_payment_method_page": { 373 | "prefix": "is_add_payment_method_page", 374 | "body": "is_add_payment_method_page()", 375 | "description": "Is_add_payment_method_page - Returns true when viewing the add payment method page." 376 | }, 377 | "is_lost_password_page": { 378 | "prefix": "is_lost_password_page", 379 | "body": "is_lost_password_page()", 380 | "description": "Is_lost_password_page - Returns true when viewing the lost password page." 381 | }, 382 | "is_ajax": { 383 | "prefix": "is_ajax", 384 | "body": "is_ajax()", 385 | "description": "Is_ajax - Returns true when the page is loaded via ajax." 386 | }, 387 | "is_store_notice_showing": { 388 | "prefix": "is_store_notice_showing", 389 | "body": "is_store_notice_showing()", 390 | "description": "Is_store_notice_showing - Returns true when store notice is active." 391 | }, 392 | "is_filtered": { 393 | "prefix": "is_filtered", 394 | "body": "is_filtered()", 395 | "description": "Is_filtered - Returns true when filtering products using layered nav or price sliders." 396 | }, 397 | "taxonomy_is_product_attribute": { 398 | "prefix": "taxonomy_is_product_attribute", 399 | "body": "taxonomy_is_product_attribute( ${1:name} )", 400 | "description": "Returns true when the passed taxonomy name is a product attribute." 401 | }, 402 | "meta_is_product_attribute": { 403 | "prefix": "meta_is_product_attribute", 404 | "body": "meta_is_product_attribute( ${1:name}, ${2:value}, ${3:product_id} )", 405 | "description": "Returns true when the passed meta name is a product attribute." 406 | }, 407 | "wc_tax_enabled": { 408 | "prefix": "wc_tax_enabled", 409 | "body": "wc_tax_enabled()", 410 | "description": "Are store-wide taxes enabled?" 411 | }, 412 | "wc_shipping_enabled": { 413 | "prefix": "wc_shipping_enabled", 414 | "body": "wc_shipping_enabled()", 415 | "description": "Is shipping enabled?" 416 | }, 417 | "wc_prices_include_tax": { 418 | "prefix": "wc_prices_include_tax", 419 | "body": "wc_prices_include_tax()", 420 | "description": "Are prices inclusive of tax?" 421 | }, 422 | "wc_is_valid_url": { 423 | "prefix": "wc_is_valid_url", 424 | "body": "wc_is_valid_url( ${1:url} )", 425 | "description": "Simple check for validating a URL, it must start with http:\/\/ or https:\/\/." 426 | }, 427 | "wc_site_is_https": { 428 | "prefix": "wc_site_is_https", 429 | "body": "wc_site_is_https()", 430 | "description": "Check if the home URL is https. If it is, we don't need to do things such as 'force ssl'." 431 | }, 432 | "wc_checkout_is_https": { 433 | "prefix": "wc_checkout_is_https", 434 | "body": "wc_checkout_is_https()", 435 | "description": "Check if the checkout is configured for https. Look at options, WP HTTPS plugin, or the permalink itself." 436 | }, 437 | "wc_post_content_has_shortcode": { 438 | "prefix": "wc_post_content_has_shortcode", 439 | "body": "wc_post_content_has_shortcode( ${1:tag} )", 440 | "description": "Checks whether the content passed contains a specific short code." 441 | }, 442 | "wc_maybe_define_constant": { 443 | "prefix": "wc_maybe_define_constant", 444 | "body": "wc_maybe_define_constant( ${1:name}, ${2:value} )", 445 | "description": "Define a constant if it is not already defined." 446 | }, 447 | "wc_create_order": { 448 | "prefix": "wc_create_order", 449 | "body": "wc_create_order( ${1:args} )", 450 | "description": "Create a new order programmatically." 451 | }, 452 | "wc_update_order": { 453 | "prefix": "wc_update_order", 454 | "body": "wc_update_order( ${1:args} )", 455 | "description": "Update an order. Uses wc_create_order." 456 | }, 457 | "wc_get_template_part": { 458 | "prefix": "wc_get_template_part", 459 | "body": "wc_get_template_part( ${1:slug}${2:, ${3:name}} )", 460 | "description": "Get template part (for templates like the shop-loop)." 461 | }, 462 | "wc_get_template": { 463 | "prefix": "wc_get_template", 464 | "body": "wc_get_template( ${1:template_name}${2:, ${3:args}${4:, ${5:template_path}${6:, ${7:default_path}}}} )", 465 | "description": "Get other templates (e.g. product attributes) passing attributes and including the file." 466 | }, 467 | "wc_get_template_html": { 468 | "prefix": "wc_get_template_html", 469 | "body": "wc_get_template_html( ${1:template_name}${2:, ${3:args}${4:, ${5:template_path}${6:, ${7:default_path}}}} )", 470 | "description": "Like wc_get_template, but returns the HTML instead of outputting." 471 | }, 472 | "wc_locate_template": { 473 | "prefix": "wc_locate_template", 474 | "body": "wc_locate_template( ${1:template_name}${2:, ${3:template_path}${4:, ${5:default_path}}} )", 475 | "description": "Locate a template and return the path for inclusion." 476 | }, 477 | "get_woocommerce_currency": { 478 | "prefix": "get_woocommerce_currency", 479 | "body": "get_woocommerce_currency()", 480 | "description": "Get Base Currency Code." 481 | }, 482 | "get_woocommerce_currencies": { 483 | "prefix": "get_woocommerce_currencies", 484 | "body": "get_woocommerce_currencies()", 485 | "description": "Get full list of currency codes." 486 | }, 487 | "get_woocommerce_currency_symbol": { 488 | "prefix": "get_woocommerce_currency_symbol", 489 | "body": "get_woocommerce_currency_symbol( ${1:currency} )", 490 | "description": "Get Currency symbol." 491 | }, 492 | "wc_mail": { 493 | "prefix": "wc_mail", 494 | "body": "wc_mail( ${1:to}, ${2:subject}, ${3:message}${4:, ${5:headers}${6:, ${7:attachments}}} )", 495 | "description": "Send HTML emails from WooCommerce." 496 | }, 497 | "wc_get_theme_support": { 498 | "prefix": "wc_get_theme_support", 499 | "body": "wc_get_theme_support( ${1:${2:prop}${3:, ${4:default}}} )", 500 | "description": "Return \"theme support\" values from the current theme, if set." 501 | }, 502 | "wc_get_image_size": { 503 | "prefix": "wc_get_image_size", 504 | "body": "wc_get_image_size( ${1:image_size} )", 505 | "description": "Get an image size by name or defined dimensions." 506 | }, 507 | "wc_enqueue_js": { 508 | "prefix": "wc_enqueue_js", 509 | "body": "wc_enqueue_js( ${1:code} )", 510 | "description": "Queue some JavaScript code to be output in the footer." 511 | }, 512 | "wc_print_js": { 513 | "prefix": "wc_print_js", 514 | "body": "wc_print_js()", 515 | "description": "Output any queued javascript code in the footer." 516 | }, 517 | "wc_setcookie": { 518 | "prefix": "wc_setcookie", 519 | "body": "wc_setcookie( ${1:name}, ${2:value}${3:, ${4:expire}${5:, ${6:secure}}} )", 520 | "description": "Set a cookie - wrapper for setcookie using WP constants." 521 | }, 522 | "get_woocommerce_api_url": { 523 | "prefix": "get_woocommerce_api_url", 524 | "body": "get_woocommerce_api_url( ${1:path} )", 525 | "description": "Get the URL to the WooCommerce REST API." 526 | }, 527 | "wc_get_log_file_path": { 528 | "prefix": "wc_get_log_file_path", 529 | "body": "wc_get_log_file_path( ${1:handle} )", 530 | "description": "Get a log file path." 531 | }, 532 | "wc_get_log_file_name": { 533 | "prefix": "wc_get_log_file_name", 534 | "body": "wc_get_log_file_name( ${1:handle} )", 535 | "description": "Get a log file name." 536 | }, 537 | "wc_get_page_children": { 538 | "prefix": "wc_get_page_children", 539 | "body": "wc_get_page_children( ${1:page_id} )", 540 | "description": "Recursively get page children." 541 | }, 542 | "flush_rewrite_rules_on_shop_page_save": { 543 | "prefix": "flush_rewrite_rules_on_shop_page_save", 544 | "body": "flush_rewrite_rules_on_shop_page_save()", 545 | "description": "Flushes rewrite rules when the shop page (or it's children) gets saved." 546 | }, 547 | "wc_fix_rewrite_rules": { 548 | "prefix": "wc_fix_rewrite_rules", 549 | "body": "wc_fix_rewrite_rules( ${1:rules} )", 550 | "description": "Various rewrite rule fixes." 551 | }, 552 | "wc_fix_product_attachment_link": { 553 | "prefix": "wc_fix_product_attachment_link", 554 | "body": "wc_fix_product_attachment_link( ${1:link}, ${2:post_id} )", 555 | "description": "Prevent product attachment links from breaking when using complex rewrite structures." 556 | }, 557 | "wc_ms_protect_download_rewite_rules": { 558 | "prefix": "wc_ms_protect_download_rewite_rules", 559 | "body": "wc_ms_protect_download_rewite_rules( ${1:rewrite} )", 560 | "description": "Protect downloads from ms-files.php in multisite." 561 | }, 562 | "wc_format_country_state_string": { 563 | "prefix": "wc_format_country_state_string", 564 | "body": "wc_format_country_state_string( ${1:country_string} )", 565 | "description": "Formats a string in the format COUNTRY:STATE into an array." 566 | }, 567 | "wc_get_base_location": { 568 | "prefix": "wc_get_base_location", 569 | "body": "wc_get_base_location()", 570 | "description": "Get the store's base location." 571 | }, 572 | "wc_get_customer_default_location": { 573 | "prefix": "wc_get_customer_default_location", 574 | "body": "wc_get_customer_default_location()", 575 | "description": "Get the customer's default location." 576 | }, 577 | "wc_get_user_agent": { 578 | "prefix": "wc_get_user_agent", 579 | "body": "wc_get_user_agent()", 580 | "description": "Get user agent string." 581 | }, 582 | "hash_equals": { 583 | "prefix": "hash_equals", 584 | "body": "hash_equals( ${1:a}, ${2:b} )", 585 | "description": "Compare two strings in constant time." 586 | }, 587 | "wc_rand_hash": { 588 | "prefix": "wc_rand_hash", 589 | "body": "wc_rand_hash()", 590 | "description": "Generate a rand hash." 591 | }, 592 | "wc_api_hash": { 593 | "prefix": "wc_api_hash", 594 | "body": "wc_api_hash( ${1:data} )", 595 | "description": "WC API - Hash." 596 | }, 597 | "wc_array_cartesian": { 598 | "prefix": "wc_array_cartesian", 599 | "body": "wc_array_cartesian( ${1:input} )", 600 | "description": "Find all possible combinations of values from the input array and return in a logical order." 601 | }, 602 | "wc_transaction_query": { 603 | "prefix": "wc_transaction_query", 604 | "body": "wc_transaction_query( ${1:${2:type}${3:, ${4:force}}} )", 605 | "description": "Run a MySQL transaction query, if supported." 606 | }, 607 | "wc_get_cart_url": { 608 | "prefix": "wc_get_cart_url", 609 | "body": "wc_get_cart_url()", 610 | "description": "Gets the url to the cart page." 611 | }, 612 | "wc_get_checkout_url": { 613 | "prefix": "wc_get_checkout_url", 614 | "body": "wc_get_checkout_url()", 615 | "description": "Gets the url to the checkout page." 616 | }, 617 | "woocommerce_register_shipping_method": { 618 | "prefix": "woocommerce_register_shipping_method", 619 | "body": "woocommerce_register_shipping_method( ${1:shipping_method} )", 620 | "description": "Register a shipping method." 621 | }, 622 | "wc_get_shipping_zone": { 623 | "prefix": "wc_get_shipping_zone", 624 | "body": "wc_get_shipping_zone( ${1:package} )", 625 | "description": "Get the shipping zone matching a given package from the cart." 626 | }, 627 | "wc_get_credit_card_type_label": { 628 | "prefix": "wc_get_credit_card_type_label", 629 | "body": "wc_get_credit_card_type_label( ${1:type} )", 630 | "description": "Get a nice name for credit card providers." 631 | }, 632 | "wc_back_link": { 633 | "prefix": "wc_back_link", 634 | "body": "wc_back_link( ${1:label}, ${2:url} )", 635 | "description": "Outputs a \"back\" link so admin screens can easily jump back a page." 636 | }, 637 | "wc_help_tip": { 638 | "prefix": "wc_help_tip", 639 | "body": "wc_help_tip( ${1:tip}${2:, ${3:allow_html}} )", 640 | "description": "Display a WooCommerce help tip." 641 | }, 642 | "wc_get_wildcard_postcodes": { 643 | "prefix": "wc_get_wildcard_postcodes", 644 | "body": "wc_get_wildcard_postcodes( ${1:postcode}${2:, ${3:country}} )", 645 | "description": "Return a list of potential postcodes for wildcard searching." 646 | }, 647 | "wc_postcode_location_matcher": { 648 | "prefix": "wc_postcode_location_matcher", 649 | "body": "wc_postcode_location_matcher( ${1:postcode}, ${2:objects}, ${3:object_id_key}, ${4:object_compare_key}${5:, ${6:country}} )", 650 | "description": "Used by shipping zones and taxes to compare a given $postcode to stored" 651 | }, 652 | "wc_get_shipping_method_count": { 653 | "prefix": "wc_get_shipping_method_count", 654 | "body": "wc_get_shipping_method_count( ${1:include_legacy} )", 655 | "description": "Gets number of shipping methods currently enabled. Used to identify if" 656 | }, 657 | "wc_set_time_limit": { 658 | "prefix": "wc_set_time_limit", 659 | "body": "wc_set_time_limit( ${1:limit} )", 660 | "description": "Wrapper for set_time_limit to see if it is enabled." 661 | }, 662 | "wc_nocache_headers": { 663 | "prefix": "wc_nocache_headers", 664 | "body": "wc_nocache_headers()", 665 | "description": "Wrapper for nocache_headers which also disables page caching." 666 | }, 667 | "wc_product_attribute_uasort_comparison": { 668 | "prefix": "wc_product_attribute_uasort_comparison", 669 | "body": "wc_product_attribute_uasort_comparison( ${1:a}, ${2:b} )", 670 | "description": "Used to sort products attributes with uasort." 671 | }, 672 | "wc_shipping_zone_method_order_uasort_comparison": { 673 | "prefix": "wc_shipping_zone_method_order_uasort_comparison", 674 | "body": "wc_shipping_zone_method_order_uasort_comparison( ${1:a}, ${2:b} )", 675 | "description": "Used to sort shipping zone methods with uasort." 676 | }, 677 | "wc_get_tax_rounding_mode": { 678 | "prefix": "wc_get_tax_rounding_mode", 679 | "body": "wc_get_tax_rounding_mode()", 680 | "description": "Get rounding mode for internal tax calculations." 681 | }, 682 | "wc_get_rounding_precision": { 683 | "prefix": "wc_get_rounding_precision", 684 | "body": "wc_get_rounding_precision()", 685 | "description": "Get rounding precision for internal WC calculations." 686 | }, 687 | "wc_add_number_precision": { 688 | "prefix": "wc_add_number_precision", 689 | "body": "wc_add_number_precision( ${1:value}${2:, ${3:round}} )", 690 | "description": "Add precision to a number and return a number." 691 | }, 692 | "wc_remove_number_precision": { 693 | "prefix": "wc_remove_number_precision", 694 | "body": "wc_remove_number_precision( ${1:value} )", 695 | "description": "Remove precision from a number and return a float." 696 | }, 697 | "wc_add_number_precision_deep": { 698 | "prefix": "wc_add_number_precision_deep", 699 | "body": "wc_add_number_precision_deep( ${1:value}${2:, ${3:round}} )", 700 | "description": "Add precision to an array of number and return an array of int." 701 | }, 702 | "wc_remove_number_precision_deep": { 703 | "prefix": "wc_remove_number_precision_deep", 704 | "body": "wc_remove_number_precision_deep( ${1:value} )", 705 | "description": "Remove precision from an array of number and return an array of int." 706 | }, 707 | "wc_get_logger": { 708 | "prefix": "wc_get_logger", 709 | "body": "wc_get_logger()", 710 | "description": "Get a shared logger instance." 711 | }, 712 | "wc_cleanup_logs": { 713 | "prefix": "wc_cleanup_logs", 714 | "body": "wc_cleanup_logs()", 715 | "description": "Trigger logging cleanup using the logging class." 716 | }, 717 | "wc_print_r": { 718 | "prefix": "wc_print_r", 719 | "body": "wc_print_r( ${1:expression}${2:, ${3:return}} )", 720 | "description": "Prints human-readable information about a variable." 721 | }, 722 | "wc_register_default_log_handler": { 723 | "prefix": "wc_register_default_log_handler", 724 | "body": "wc_register_default_log_handler( ${1:handlers} )", 725 | "description": "Registers the default log handler." 726 | }, 727 | "wc_list_pluck": { 728 | "prefix": "wc_list_pluck", 729 | "body": "wc_list_pluck( ${1:list}, ${2:callback_or_field}${3:, ${4:index_key}} )", 730 | "description": "Based on wp_list_pluck, this calls a method instead of returning a property." 731 | }, 732 | "wc_get_permalink_structure": { 733 | "prefix": "wc_get_permalink_structure", 734 | "body": "wc_get_permalink_structure()", 735 | "description": "Get permalink settings for things like products and taxonomies." 736 | }, 737 | "wc_switch_to_site_locale": { 738 | "prefix": "wc_switch_to_site_locale", 739 | "body": "wc_switch_to_site_locale()", 740 | "description": "Switch WooCommerce to site language." 741 | }, 742 | "wc_restore_locale": { 743 | "prefix": "wc_restore_locale", 744 | "body": "wc_restore_locale()", 745 | "description": "Switch WooCommerce language to original." 746 | }, 747 | "wc_make_phone_clickable": { 748 | "prefix": "wc_make_phone_clickable", 749 | "body": "wc_make_phone_clickable( ${1:phone} )", 750 | "description": "Convert plaintext phone number to clickable phone number." 751 | }, 752 | "wc_get_post_data_by_key": { 753 | "prefix": "wc_get_post_data_by_key", 754 | "body": "wc_get_post_data_by_key( ${1:key}${2:, ${3:default}} )", 755 | "description": "Get an item of post data if set, otherwise return a default value." 756 | }, 757 | "wc_get_var": { 758 | "prefix": "wc_get_var", 759 | "body": "wc_get_var( ${1:&var}${2:, ${3:default}} )", 760 | "description": "Get data if set, otherwise return a default value or null. Prevents notices when data is not set." 761 | }, 762 | "wc_enable_wc_plugin_headers": { 763 | "prefix": "wc_enable_wc_plugin_headers", 764 | "body": "wc_enable_wc_plugin_headers( ${1:headers} )", 765 | "description": "Read in WooCommerce headers when reading plugin headers." 766 | }, 767 | "wc_prevent_dangerous_auto_updates": { 768 | "prefix": "wc_prevent_dangerous_auto_updates", 769 | "body": "wc_prevent_dangerous_auto_updates( ${1:should_update}, ${2:plugin} )", 770 | "description": "Prevent auto-updating the WooCommerce plugin on major releases if there are untested extensions active." 771 | }, 772 | "wc_delete_expired_transients": { 773 | "prefix": "wc_delete_expired_transients", 774 | "body": "wc_delete_expired_transients()", 775 | "description": "Delete expired transients." 776 | }, 777 | "wc_get_relative_url": { 778 | "prefix": "wc_get_relative_url", 779 | "body": "wc_get_relative_url( ${1:url} )", 780 | "description": "Make a URL relative, if possible." 781 | }, 782 | "wc_is_external_resource": { 783 | "prefix": "wc_is_external_resource", 784 | "body": "wc_is_external_resource( ${1:url} )", 785 | "description": "See if a resource is remote." 786 | }, 787 | "wc_is_active_theme": { 788 | "prefix": "wc_is_active_theme", 789 | "body": "wc_is_active_theme( ${1:theme} )", 790 | "description": "See if theme\/s is activate or not." 791 | }, 792 | "wc_cleanup_session_data": { 793 | "prefix": "wc_cleanup_session_data", 794 | "body": "wc_cleanup_session_data()", 795 | "description": "Cleans up session data - cron callback." 796 | }, 797 | "wc_decimal_to_fraction": { 798 | "prefix": "wc_decimal_to_fraction", 799 | "body": "wc_decimal_to_fraction( ${1:decimal} )", 800 | "description": "Convert a decimal (e.g. 3.5) to a fraction (e.g. 7\/2)." 801 | }, 802 | "wc_round_discount": { 803 | "prefix": "wc_round_discount", 804 | "body": "wc_round_discount( ${1:value}, ${2:precision} )", 805 | "description": "Round discount." 806 | }, 807 | "wc_selected": { 808 | "prefix": "wc_selected", 809 | "body": "wc_selected( ${1:value}, ${2:options} )", 810 | "description": "Return the html selected attribute if stringified $value is found in array of stringified $options" 811 | }, 812 | "wc_get_server_database_version": { 813 | "prefix": "wc_get_server_database_version", 814 | "body": "wc_get_server_database_version()", 815 | "description": "Retrieves the MySQL server version. Based on $wpdb." 816 | }, 817 | "wc_get_coupon_types": { 818 | "prefix": "wc_get_coupon_types", 819 | "body": "wc_get_coupon_types()", 820 | "description": "Get coupon types." 821 | }, 822 | "wc_get_coupon_type": { 823 | "prefix": "wc_get_coupon_type", 824 | "body": "wc_get_coupon_type( ${1:type} )", 825 | "description": "Get a coupon type's name." 826 | }, 827 | "wc_get_product_coupon_types": { 828 | "prefix": "wc_get_product_coupon_types", 829 | "body": "wc_get_product_coupon_types()", 830 | "description": "Coupon types that apply to individual products. Controls which validation rules will apply." 831 | }, 832 | "wc_get_cart_coupon_types": { 833 | "prefix": "wc_get_cart_coupon_types", 834 | "body": "wc_get_cart_coupon_types()", 835 | "description": "Coupon types that apply to the cart as a whole. Controls which validation rules will apply." 836 | }, 837 | "wc_coupons_enabled": { 838 | "prefix": "wc_coupons_enabled", 839 | "body": "wc_coupons_enabled()", 840 | "description": "Check if coupons are enabled." 841 | }, 842 | "wc_get_coupon_code_by_id": { 843 | "prefix": "wc_get_coupon_code_by_id", 844 | "body": "wc_get_coupon_code_by_id( ${1:id} )", 845 | "description": "Get coupon code by ID." 846 | }, 847 | "wc_get_coupon_id_by_code": { 848 | "prefix": "wc_get_coupon_id_by_code", 849 | "body": "wc_get_coupon_id_by_code( ${1:code}${2:, ${3:exclude}} )", 850 | "description": "Get coupon code by ID." 851 | }, 852 | "wc_string_to_bool": { 853 | "prefix": "wc_string_to_bool", 854 | "body": "wc_string_to_bool( ${1:string} )", 855 | "description": "Converts a string (e.g. 'yes' or 'no') to a bool." 856 | }, 857 | "wc_bool_to_string": { 858 | "prefix": "wc_bool_to_string", 859 | "body": "wc_bool_to_string( ${1:bool} )", 860 | "description": "Converts a bool to a 'yes' or 'no'." 861 | }, 862 | "wc_string_to_array": { 863 | "prefix": "wc_string_to_array", 864 | "body": "wc_string_to_array( ${1:string}${2:, ${3:delimiter}} )", 865 | "description": "Explode a string into an array by $delimiter and remove empty values." 866 | }, 867 | "wc_sanitize_taxonomy_name": { 868 | "prefix": "wc_sanitize_taxonomy_name", 869 | "body": "wc_sanitize_taxonomy_name( ${1:taxonomy} )", 870 | "description": "Sanitize taxonomy names. Slug format (no spaces, lowercase)." 871 | }, 872 | "wc_sanitize_permalink": { 873 | "prefix": "wc_sanitize_permalink", 874 | "body": "wc_sanitize_permalink( ${1:value} )", 875 | "description": "Sanitize permalink values before insertion into DB." 876 | }, 877 | "wc_get_filename_from_url": { 878 | "prefix": "wc_get_filename_from_url", 879 | "body": "wc_get_filename_from_url( ${1:file_url} )", 880 | "description": "Gets the filename part of a download URL." 881 | }, 882 | "wc_get_dimension": { 883 | "prefix": "wc_get_dimension", 884 | "body": "wc_get_dimension( ${1:dimension}, ${2:to_unit}${3:, ${4:from_unit}} )", 885 | "description": "Normalise dimensions, unify to cm then convert to wanted unit value." 886 | }, 887 | "wc_get_weight": { 888 | "prefix": "wc_get_weight", 889 | "body": "wc_get_weight( ${1:weight}, ${2:to_unit}${3:, ${4:from_unit}} )", 890 | "description": "Normalise weights, unify to kg then convert to wanted unit value." 891 | }, 892 | "wc_trim_zeros": { 893 | "prefix": "wc_trim_zeros", 894 | "body": "wc_trim_zeros( ${1:price} )", 895 | "description": "Trim trailing zeros off prices." 896 | }, 897 | "wc_round_tax_total": { 898 | "prefix": "wc_round_tax_total", 899 | "body": "wc_round_tax_total( ${1:value}${2:, ${3:precision}} )", 900 | "description": "Round a tax amount." 901 | }, 902 | "wc_legacy_round_half_down": { 903 | "prefix": "wc_legacy_round_half_down", 904 | "body": "wc_legacy_round_half_down( ${1:value}, ${2:precision} )", 905 | "description": "Round half down in PHP 5.2." 906 | }, 907 | "wc_format_refund_total": { 908 | "prefix": "wc_format_refund_total", 909 | "body": "wc_format_refund_total( ${1:amount} )", 910 | "description": "Make a refund total negative." 911 | }, 912 | "wc_format_decimal": { 913 | "prefix": "wc_format_decimal", 914 | "body": "wc_format_decimal( ${1:number}${2:, ${3:dp}${4:, ${5:trim_zeros}}} )", 915 | "description": "Format decimal numbers ready for DB storage." 916 | }, 917 | "wc_float_to_string": { 918 | "prefix": "wc_float_to_string", 919 | "body": "wc_float_to_string( ${1:float} )", 920 | "description": "Convert a float to a string without locale formatting which PHP adds when changing floats to strings." 921 | }, 922 | "wc_format_localized_price": { 923 | "prefix": "wc_format_localized_price", 924 | "body": "wc_format_localized_price( ${1:value} )", 925 | "description": "Format a price with WC Currency Locale settings." 926 | }, 927 | "wc_format_localized_decimal": { 928 | "prefix": "wc_format_localized_decimal", 929 | "body": "wc_format_localized_decimal( ${1:value} )", 930 | "description": "Format a decimal with PHP Locale settings." 931 | }, 932 | "wc_format_coupon_code": { 933 | "prefix": "wc_format_coupon_code", 934 | "body": "wc_format_coupon_code( ${1:value} )", 935 | "description": "Format a coupon code." 936 | }, 937 | "wc_clean": { 938 | "prefix": "wc_clean", 939 | "body": "wc_clean( ${1:var} )", 940 | "description": "Clean variables using sanitize_text_field. Arrays are cleaned recursively." 941 | }, 942 | "wc_check_invalid_utf8": { 943 | "prefix": "wc_check_invalid_utf8", 944 | "body": "wc_check_invalid_utf8( ${1:var} )", 945 | "description": "wp_check_invalid_utf8 with recursive array support." 946 | }, 947 | "wc_sanitize_textarea": { 948 | "prefix": "wc_sanitize_textarea", 949 | "body": "wc_sanitize_textarea( ${1:var} )", 950 | "description": "Run wc_clean over posted textarea but maintain line breaks." 951 | }, 952 | "wc_sanitize_tooltip": { 953 | "prefix": "wc_sanitize_tooltip", 954 | "body": "wc_sanitize_tooltip( ${1:var} )", 955 | "description": "Sanitize a string destined to be a tooltip." 956 | }, 957 | "wc_array_overlay": { 958 | "prefix": "wc_array_overlay", 959 | "body": "wc_array_overlay( ${1:a1}, ${2:a2} )", 960 | "description": "Merge two arrays." 961 | }, 962 | "wc_stock_amount": { 963 | "prefix": "wc_stock_amount", 964 | "body": "wc_stock_amount( ${1:amount} )", 965 | "description": "Formats a stock amount by running it through a filter." 966 | }, 967 | "get_woocommerce_price_format": { 968 | "prefix": "get_woocommerce_price_format", 969 | "body": "get_woocommerce_price_format()", 970 | "description": "Get the price format depending on the currency position." 971 | }, 972 | "wc_get_price_thousand_separator": { 973 | "prefix": "wc_get_price_thousand_separator", 974 | "body": "wc_get_price_thousand_separator()", 975 | "description": "Return the thousand separator for prices." 976 | }, 977 | "wc_get_price_decimal_separator": { 978 | "prefix": "wc_get_price_decimal_separator", 979 | "body": "wc_get_price_decimal_separator()", 980 | "description": "Return the decimal separator for prices." 981 | }, 982 | "wc_get_price_decimals": { 983 | "prefix": "wc_get_price_decimals", 984 | "body": "wc_get_price_decimals()", 985 | "description": "Return the number of decimals after the decimal point." 986 | }, 987 | "wc_price": { 988 | "prefix": "wc_price", 989 | "body": "wc_price( ${1:price}${2:, ${3:args}} )", 990 | "description": "Format the price with a currency symbol." 991 | }, 992 | "wc_let_to_num": { 993 | "prefix": "wc_let_to_num", 994 | "body": "wc_let_to_num( ${1:size} )", 995 | "description": "Notation to numbers." 996 | }, 997 | "wc_date_format": { 998 | "prefix": "wc_date_format", 999 | "body": "wc_date_format()", 1000 | "description": "WooCommerce Date Format - Allows to change date format for everything WooCommerce." 1001 | }, 1002 | "wc_time_format": { 1003 | "prefix": "wc_time_format", 1004 | "body": "wc_time_format()", 1005 | "description": "WooCommerce Time Format - Allows to change time format for everything WooCommerce." 1006 | }, 1007 | "wc_string_to_timestamp": { 1008 | "prefix": "wc_string_to_timestamp", 1009 | "body": "wc_string_to_timestamp( ${1:time_string}${2:, ${3:from_timestamp}} )", 1010 | "description": "Convert mysql datetime to PHP timestamp, forcing UTC. Wrapper for strtotime." 1011 | }, 1012 | "wc_string_to_datetime": { 1013 | "prefix": "wc_string_to_datetime", 1014 | "body": "wc_string_to_datetime( ${1:time_string} )", 1015 | "description": "Convert a date string to a WC_DateTime." 1016 | }, 1017 | "wc_timezone_string": { 1018 | "prefix": "wc_timezone_string", 1019 | "body": "wc_timezone_string()", 1020 | "description": "WooCommerce Timezone - helper to retrieve the timezone string for a site until." 1021 | }, 1022 | "wc_timezone_offset": { 1023 | "prefix": "wc_timezone_offset", 1024 | "body": "wc_timezone_offset()", 1025 | "description": "Get timezone offset in seconds." 1026 | }, 1027 | "wc_flatten_meta_callback": { 1028 | "prefix": "wc_flatten_meta_callback", 1029 | "body": "wc_flatten_meta_callback( ${1:value} )", 1030 | "description": "Callback which can flatten post meta (gets the first value if it's an array)." 1031 | }, 1032 | "wc_rgb_from_hex": { 1033 | "prefix": "wc_rgb_from_hex", 1034 | "body": "wc_rgb_from_hex( ${1:color} )", 1035 | "description": "Convert RGB to HEX." 1036 | }, 1037 | "wc_hex_darker": { 1038 | "prefix": "wc_hex_darker", 1039 | "body": "wc_hex_darker( ${1:color}${2:, ${3:factor}} )", 1040 | "description": "Make HEX color darker." 1041 | }, 1042 | "wc_hex_lighter": { 1043 | "prefix": "wc_hex_lighter", 1044 | "body": "wc_hex_lighter( ${1:color}${2:, ${3:factor}} )", 1045 | "description": "Make HEX color lighter." 1046 | }, 1047 | "wc_hex_is_light": { 1048 | "prefix": "wc_hex_is_light", 1049 | "body": "wc_hex_is_light( ${1:color} )", 1050 | "description": "Determine whether a hex color is light." 1051 | }, 1052 | "wc_light_or_dark": { 1053 | "prefix": "wc_light_or_dark", 1054 | "body": "wc_light_or_dark( ${1:color}${2:, ${3:dark}${4:, ${5:light}}} )", 1055 | "description": "Detect if we should use a light or dark color on a background color." 1056 | }, 1057 | "wc_format_hex": { 1058 | "prefix": "wc_format_hex", 1059 | "body": "wc_format_hex( ${1:hex} )", 1060 | "description": "Format string as hex." 1061 | }, 1062 | "wc_format_postcode": { 1063 | "prefix": "wc_format_postcode", 1064 | "body": "wc_format_postcode( ${1:postcode}, ${2:country} )", 1065 | "description": "Format the postcode according to the country and length of the postcode." 1066 | }, 1067 | "wc_normalize_postcode": { 1068 | "prefix": "wc_normalize_postcode", 1069 | "body": "wc_normalize_postcode( ${1:postcode} )", 1070 | "description": "Normalize postcodes." 1071 | }, 1072 | "wc_format_phone_number": { 1073 | "prefix": "wc_format_phone_number", 1074 | "body": "wc_format_phone_number( ${1:phone} )", 1075 | "description": "Format phone numbers." 1076 | }, 1077 | "wc_strtoupper": { 1078 | "prefix": "wc_strtoupper", 1079 | "body": "wc_strtoupper( ${1:string} )", 1080 | "description": "Wrapper for mb_strtoupper which see's if supported first." 1081 | }, 1082 | "wc_strtolower": { 1083 | "prefix": "wc_strtolower", 1084 | "body": "wc_strtolower( ${1:string} )", 1085 | "description": "Make a string lowercase." 1086 | }, 1087 | "wc_trim_string": { 1088 | "prefix": "wc_trim_string", 1089 | "body": "wc_trim_string( ${1:string}${2:, ${3:chars}${4:, ${5:suffix}}} )", 1090 | "description": "Trim a string and append a suffix." 1091 | }, 1092 | "wc_format_content": { 1093 | "prefix": "wc_format_content", 1094 | "body": "wc_format_content( ${1:raw_string} )", 1095 | "description": "Format content to display shortcodes." 1096 | }, 1097 | "wc_format_product_short_description": { 1098 | "prefix": "wc_format_product_short_description", 1099 | "body": "wc_format_product_short_description( ${1:content} )", 1100 | "description": "Format product short description." 1101 | }, 1102 | "wc_format_option_price_separators": { 1103 | "prefix": "wc_format_option_price_separators", 1104 | "body": "wc_format_option_price_separators( ${1:value}, ${2:option}, ${3:raw_value} )", 1105 | "description": "Formats curency symbols when saved in settings." 1106 | }, 1107 | "wc_format_option_price_num_decimals": { 1108 | "prefix": "wc_format_option_price_num_decimals", 1109 | "body": "wc_format_option_price_num_decimals( ${1:value}, ${2:option}, ${3:raw_value} )", 1110 | "description": "Formats decimals when saved in settings." 1111 | }, 1112 | "wc_format_option_hold_stock_minutes": { 1113 | "prefix": "wc_format_option_hold_stock_minutes", 1114 | "body": "wc_format_option_hold_stock_minutes( ${1:value}, ${2:option}, ${3:raw_value} )", 1115 | "description": "Formats hold stock option and sets cron event up." 1116 | }, 1117 | "wc_sanitize_term_text_based": { 1118 | "prefix": "wc_sanitize_term_text_based", 1119 | "body": "wc_sanitize_term_text_based( ${1:term} )", 1120 | "description": "Sanitize terms from an attribute text based." 1121 | }, 1122 | "wc_make_numeric_postcode": { 1123 | "prefix": "wc_make_numeric_postcode", 1124 | "body": "wc_make_numeric_postcode( ${1:postcode} )", 1125 | "description": "Make numeric postcode." 1126 | }, 1127 | "wc_format_stock_for_display": { 1128 | "prefix": "wc_format_stock_for_display", 1129 | "body": "wc_format_stock_for_display( ${1:product} )", 1130 | "description": "Format the stock amount ready for display based on settings." 1131 | }, 1132 | "wc_format_stock_quantity_for_display": { 1133 | "prefix": "wc_format_stock_quantity_for_display", 1134 | "body": "wc_format_stock_quantity_for_display( ${1:stock_quantity}, ${2:product} )", 1135 | "description": "Format the stock quantity ready for display." 1136 | }, 1137 | "wc_format_sale_price": { 1138 | "prefix": "wc_format_sale_price", 1139 | "body": "wc_format_sale_price( ${1:regular_price}, ${2:sale_price} )", 1140 | "description": "Format a sale price for display." 1141 | }, 1142 | "wc_format_price_range": { 1143 | "prefix": "wc_format_price_range", 1144 | "body": "wc_format_price_range( ${1:from}, ${2:to} )", 1145 | "description": "Format a price range for display." 1146 | }, 1147 | "wc_format_weight": { 1148 | "prefix": "wc_format_weight", 1149 | "body": "wc_format_weight( ${1:weight} )", 1150 | "description": "Format a weight for display." 1151 | }, 1152 | "wc_format_dimensions": { 1153 | "prefix": "wc_format_dimensions", 1154 | "body": "wc_format_dimensions( ${1:dimensions} )", 1155 | "description": "Format dimensions for display." 1156 | }, 1157 | "wc_format_datetime": { 1158 | "prefix": "wc_format_datetime", 1159 | "body": "wc_format_datetime( ${1:date}${2:, ${3:format}} )", 1160 | "description": "Format a date for output." 1161 | }, 1162 | "wc_do_oembeds": { 1163 | "prefix": "wc_do_oembeds", 1164 | "body": "wc_do_oembeds( ${1:content} )", 1165 | "description": "Process oEmbeds." 1166 | }, 1167 | "wc_get_string_before_colon": { 1168 | "prefix": "wc_get_string_before_colon", 1169 | "body": "wc_get_string_before_colon( ${1:string} )", 1170 | "description": "Get part of a string before :." 1171 | }, 1172 | "wc_array_merge_recursive_numeric": { 1173 | "prefix": "wc_array_merge_recursive_numeric", 1174 | "body": "wc_array_merge_recursive_numeric()", 1175 | "description": "Array merge and sum function." 1176 | }, 1177 | "wc_implode_html_attributes": { 1178 | "prefix": "wc_implode_html_attributes", 1179 | "body": "wc_implode_html_attributes( ${1:raw_attributes} )", 1180 | "description": "Implode and escape HTML attributes for output." 1181 | }, 1182 | "wc_parse_relative_date_option": { 1183 | "prefix": "wc_parse_relative_date_option", 1184 | "body": "wc_parse_relative_date_option( ${1:raw_value} )", 1185 | "description": "Parse a relative date option from the settings API into a standard format." 1186 | }, 1187 | "wc_sanitize_endpoint_slug": { 1188 | "prefix": "wc_sanitize_endpoint_slug", 1189 | "body": "wc_sanitize_endpoint_slug( ${1:raw_value} )", 1190 | "description": "Format the endpoint slug, strip out anything not allowed in a url." 1191 | }, 1192 | "wc_notice_count": { 1193 | "prefix": "wc_notice_count", 1194 | "body": "wc_notice_count( ${1:notice_type} )", 1195 | "description": "Get the count of notices added, either for all notices (default) or for one." 1196 | }, 1197 | "wc_has_notice": { 1198 | "prefix": "wc_has_notice", 1199 | "body": "wc_has_notice( ${1:message}${2:, ${3:notice_type}} )", 1200 | "description": "Check if a notice has already been added." 1201 | }, 1202 | "wc_add_notice": { 1203 | "prefix": "wc_add_notice", 1204 | "body": "wc_add_notice( ${1:message}${2:, ${3:notice_type}} )", 1205 | "description": "Add and store a notice." 1206 | }, 1207 | "wc_set_notices": { 1208 | "prefix": "wc_set_notices", 1209 | "body": "wc_set_notices( ${1:notices} )", 1210 | "description": "Set all notices at once." 1211 | }, 1212 | "wc_clear_notices": { 1213 | "prefix": "wc_clear_notices", 1214 | "body": "wc_clear_notices()", 1215 | "description": "Unset all notices." 1216 | }, 1217 | "wc_print_notices": { 1218 | "prefix": "wc_print_notices", 1219 | "body": "wc_print_notices( ${1:return} )", 1220 | "description": "Prints messages and errors which are stored in the session, then clears them." 1221 | }, 1222 | "wc_print_notice": { 1223 | "prefix": "wc_print_notice", 1224 | "body": "wc_print_notice( ${1:message}${2:, ${3:notice_type}} )", 1225 | "description": "Print a single notice immediately." 1226 | }, 1227 | "wc_get_notices": { 1228 | "prefix": "wc_get_notices", 1229 | "body": "wc_get_notices( ${1:notice_type} )", 1230 | "description": "Returns all queued notices, optionally filtered by a notice type." 1231 | }, 1232 | "wc_add_wp_error_notices": { 1233 | "prefix": "wc_add_wp_error_notices", 1234 | "body": "wc_add_wp_error_notices( ${1:errors} )", 1235 | "description": "Add notices for WP Errors." 1236 | }, 1237 | "wc_kses_notice": { 1238 | "prefix": "wc_kses_notice", 1239 | "body": "wc_kses_notice( ${1:message} )", 1240 | "description": "Filters out the same tags as wp_kses_post, but allows tabindex for element." 1241 | }, 1242 | "wc_get_orders": { 1243 | "prefix": "wc_get_orders", 1244 | "body": "wc_get_orders( ${1:args} )", 1245 | "description": "Standard way of retrieving orders based on certain parameters." 1246 | }, 1247 | "wc_get_order": { 1248 | "prefix": "wc_get_order", 1249 | "body": "wc_get_order( ${1:the_order} )", 1250 | "description": "Main function for returning orders, uses the WC_Order_Factory class." 1251 | }, 1252 | "wc_get_order_statuses": { 1253 | "prefix": "wc_get_order_statuses", 1254 | "body": "wc_get_order_statuses()", 1255 | "description": "Get all order statuses." 1256 | }, 1257 | "wc_is_order_status": { 1258 | "prefix": "wc_is_order_status", 1259 | "body": "wc_is_order_status( ${1:maybe_status} )", 1260 | "description": "See if a string is an order status." 1261 | }, 1262 | "wc_get_is_paid_statuses": { 1263 | "prefix": "wc_get_is_paid_statuses", 1264 | "body": "wc_get_is_paid_statuses()", 1265 | "description": "Get list of statuses which are consider 'paid'." 1266 | }, 1267 | "wc_get_order_status_name": { 1268 | "prefix": "wc_get_order_status_name", 1269 | "body": "wc_get_order_status_name( ${1:status} )", 1270 | "description": "Get the nice name for an order status." 1271 | }, 1272 | "wc_get_order_id_by_order_key": { 1273 | "prefix": "wc_get_order_id_by_order_key", 1274 | "body": "wc_get_order_id_by_order_key( ${1:order_key} )", 1275 | "description": "Finds an Order ID based on an order key." 1276 | }, 1277 | "wc_get_order_types": { 1278 | "prefix": "wc_get_order_types", 1279 | "body": "wc_get_order_types( ${1:for} )", 1280 | "description": "Get all registered order types." 1281 | }, 1282 | "wc_get_order_type": { 1283 | "prefix": "wc_get_order_type", 1284 | "body": "wc_get_order_type( ${1:type} )", 1285 | "description": "Get an order type by post type name." 1286 | }, 1287 | "wc_register_order_type": { 1288 | "prefix": "wc_register_order_type", 1289 | "body": "wc_register_order_type( ${1:type}${2:, ${3:args}} )", 1290 | "description": "Register order type. Do not use before init." 1291 | }, 1292 | "wc_processing_order_count": { 1293 | "prefix": "wc_processing_order_count", 1294 | "body": "wc_processing_order_count()", 1295 | "description": "Return the count of processing orders." 1296 | }, 1297 | "wc_orders_count": { 1298 | "prefix": "wc_orders_count", 1299 | "body": "wc_orders_count( ${1:status} )", 1300 | "description": "Return the orders count of a specific order status." 1301 | }, 1302 | "wc_downloadable_file_permission": { 1303 | "prefix": "wc_downloadable_file_permission", 1304 | "body": "wc_downloadable_file_permission( ${1:download_id}, ${2:product}, ${3:order}${4:, ${5:qty}} )", 1305 | "description": "Grant downloadable product access to the file identified by $download_id." 1306 | }, 1307 | "wc_downloadable_product_permissions": { 1308 | "prefix": "wc_downloadable_product_permissions", 1309 | "body": "wc_downloadable_product_permissions( ${1:order_id}${2:, ${3:force}} )", 1310 | "description": "Order Status completed - give downloadable product access to customer." 1311 | }, 1312 | "wc_delete_shop_order_transients": { 1313 | "prefix": "wc_delete_shop_order_transients", 1314 | "body": "wc_delete_shop_order_transients( ${1:order} )", 1315 | "description": "Clear all transients cache for order data." 1316 | }, 1317 | "wc_ship_to_billing_address_only": { 1318 | "prefix": "wc_ship_to_billing_address_only", 1319 | "body": "wc_ship_to_billing_address_only()", 1320 | "description": "See if we only ship to billing addresses." 1321 | }, 1322 | "wc_create_refund": { 1323 | "prefix": "wc_create_refund", 1324 | "body": "wc_create_refund( ${1:args} )", 1325 | "description": "Create a new order refund programmatically." 1326 | }, 1327 | "wc_refund_payment": { 1328 | "prefix": "wc_refund_payment", 1329 | "body": "wc_refund_payment( ${1:order}, ${2:amount}${3:, ${4:reason}} )", 1330 | "description": "Try to refund the payment for an order via the gateway." 1331 | }, 1332 | "wc_restock_refunded_items": { 1333 | "prefix": "wc_restock_refunded_items", 1334 | "body": "wc_restock_refunded_items( ${1:order}, ${2:refunded_line_items} )", 1335 | "description": "Restock items during refund." 1336 | }, 1337 | "wc_get_tax_class_by_tax_id": { 1338 | "prefix": "wc_get_tax_class_by_tax_id", 1339 | "body": "wc_get_tax_class_by_tax_id( ${1:tax_id} )", 1340 | "description": "Get tax class by tax id." 1341 | }, 1342 | "wc_get_payment_gateway_by_order": { 1343 | "prefix": "wc_get_payment_gateway_by_order", 1344 | "body": "wc_get_payment_gateway_by_order( ${1:order} )", 1345 | "description": "Get payment gateway class by order data." 1346 | }, 1347 | "wc_order_fully_refunded": { 1348 | "prefix": "wc_order_fully_refunded", 1349 | "body": "wc_order_fully_refunded( ${1:order_id} )", 1350 | "description": "When refunding an order, create a refund line item if the partial refunds do not match order total." 1351 | }, 1352 | "wc_order_search": { 1353 | "prefix": "wc_order_search", 1354 | "body": "wc_order_search( ${1:term} )", 1355 | "description": "Search orders." 1356 | }, 1357 | "wc_update_total_sales_counts": { 1358 | "prefix": "wc_update_total_sales_counts", 1359 | "body": "wc_update_total_sales_counts( ${1:order_id} )", 1360 | "description": "Update total sales amount for each product within a paid order." 1361 | }, 1362 | "wc_update_coupon_usage_counts": { 1363 | "prefix": "wc_update_coupon_usage_counts", 1364 | "body": "wc_update_coupon_usage_counts( ${1:order_id} )", 1365 | "description": "Update used coupon amount for each coupon within an order." 1366 | }, 1367 | "wc_cancel_unpaid_orders": { 1368 | "prefix": "wc_cancel_unpaid_orders", 1369 | "body": "wc_cancel_unpaid_orders()", 1370 | "description": "Cancel all unpaid orders after held duration to prevent stock lock for those products." 1371 | }, 1372 | "wc_sanitize_order_id": { 1373 | "prefix": "wc_sanitize_order_id", 1374 | "body": "wc_sanitize_order_id( ${1:order_id} )", 1375 | "description": "Sanitize order id removing unwanted characters." 1376 | }, 1377 | "wc_get_order_note": { 1378 | "prefix": "wc_get_order_note", 1379 | "body": "wc_get_order_note( ${1:data} )", 1380 | "description": "Get an order note." 1381 | }, 1382 | "wc_get_order_notes": { 1383 | "prefix": "wc_get_order_notes", 1384 | "body": "wc_get_order_notes( ${1:args} )", 1385 | "description": "Get order notes." 1386 | }, 1387 | "wc_create_order_note": { 1388 | "prefix": "wc_create_order_note", 1389 | "body": "wc_create_order_note( ${1:order_id}, ${2:note}${3:, ${4:is_customer_note}${5:, ${6:added_by_user}}} )", 1390 | "description": "Create an order note." 1391 | }, 1392 | "wc_delete_order_note": { 1393 | "prefix": "wc_delete_order_note", 1394 | "body": "wc_delete_order_note( ${1:note_id} )", 1395 | "description": "Delete an order note." 1396 | }, 1397 | "wc_add_order_item": { 1398 | "prefix": "wc_add_order_item", 1399 | "body": "wc_add_order_item( ${1:order_id}, ${2:item_array} )", 1400 | "description": "Add a item to an order (for example a line item)." 1401 | }, 1402 | "wc_update_order_item": { 1403 | "prefix": "wc_update_order_item", 1404 | "body": "wc_update_order_item( ${1:item_id}, ${2:args} )", 1405 | "description": "Update an item for an order." 1406 | }, 1407 | "wc_delete_order_item": { 1408 | "prefix": "wc_delete_order_item", 1409 | "body": "wc_delete_order_item( ${1:item_id} )", 1410 | "description": "Delete an item from the order it belongs to based on item id." 1411 | }, 1412 | "wc_update_order_item_meta": { 1413 | "prefix": "wc_update_order_item_meta", 1414 | "body": "wc_update_order_item_meta( ${1:item_id}, ${2:meta_key}, ${3:meta_value}${4:, ${5:prev_value}} )", 1415 | "description": "WooCommerce Order Item Meta API - Update term meta." 1416 | }, 1417 | "wc_add_order_item_meta": { 1418 | "prefix": "wc_add_order_item_meta", 1419 | "body": "wc_add_order_item_meta( ${1:item_id}, ${2:meta_key}, ${3:meta_value}${4:, ${5:unique}} )", 1420 | "description": "WooCommerce Order Item Meta API - Add term meta." 1421 | }, 1422 | "wc_delete_order_item_meta": { 1423 | "prefix": "wc_delete_order_item_meta", 1424 | "body": "wc_delete_order_item_meta( ${1:item_id}, ${2:meta_key}${3:, ${4:meta_value}${5:, ${6:delete_all}}} )", 1425 | "description": "WooCommerce Order Item Meta API - Delete term meta." 1426 | }, 1427 | "wc_get_order_item_meta": { 1428 | "prefix": "wc_get_order_item_meta", 1429 | "body": "wc_get_order_item_meta( ${1:item_id}, ${2:key}${3:, ${4:single}} )", 1430 | "description": "WooCommerce Order Item Meta API - Get term meta." 1431 | }, 1432 | "wc_get_order_id_by_order_item_id": { 1433 | "prefix": "wc_get_order_id_by_order_item_id", 1434 | "body": "wc_get_order_id_by_order_item_id( ${1:item_id} )", 1435 | "description": "Get order ID by order item ID." 1436 | }, 1437 | "wc_page_endpoint_title": { 1438 | "prefix": "wc_page_endpoint_title", 1439 | "body": "wc_page_endpoint_title( ${1:title} )", 1440 | "description": "Replace a page title with the endpoint title." 1441 | }, 1442 | "wc_get_page_id": { 1443 | "prefix": "wc_get_page_id", 1444 | "body": "wc_get_page_id( ${1:page} )", 1445 | "description": "Retrieve page ids - used for myaccount, edit_address, shop, cart, checkout, pay, view_order, terms. returns -1 if no page is found." 1446 | }, 1447 | "wc_get_page_permalink": { 1448 | "prefix": "wc_get_page_permalink", 1449 | "body": "wc_get_page_permalink( ${1:page}${2:, ${3:fallback}} )", 1450 | "description": "Retrieve page permalink." 1451 | }, 1452 | "wc_get_endpoint_url": { 1453 | "prefix": "wc_get_endpoint_url", 1454 | "body": "wc_get_endpoint_url( ${1:endpoint}${2:, ${3:value}${4:, ${5:permalink}}} )", 1455 | "description": "Get endpoint URL." 1456 | }, 1457 | "wc_nav_menu_items": { 1458 | "prefix": "wc_nav_menu_items", 1459 | "body": "wc_nav_menu_items( ${1:items} )", 1460 | "description": "Hide menu items conditionally." 1461 | }, 1462 | "wc_nav_menu_item_classes": { 1463 | "prefix": "wc_nav_menu_item_classes", 1464 | "body": "wc_nav_menu_item_classes( ${1:menu_items} )", 1465 | "description": "Fix active class in nav for shop page." 1466 | }, 1467 | "wc_list_pages": { 1468 | "prefix": "wc_list_pages", 1469 | "body": "wc_list_pages( ${1:pages} )", 1470 | "description": "Fix active class in wp_list_pages for shop page." 1471 | }, 1472 | "wc_get_products": { 1473 | "prefix": "wc_get_products", 1474 | "body": "wc_get_products( ${1:args} )", 1475 | "description": "Standard way of retrieving products based on certain parameters." 1476 | }, 1477 | "wc_get_product": { 1478 | "prefix": "wc_get_product", 1479 | "body": "wc_get_product( ${1:${2:the_product}${3:, ${4:deprecated}}} )", 1480 | "description": "Main function for returning products, uses the WC_Product_Factory class." 1481 | }, 1482 | "wc_product_sku_enabled": { 1483 | "prefix": "wc_product_sku_enabled", 1484 | "body": "wc_product_sku_enabled()", 1485 | "description": "Returns whether or not SKUS are enabled." 1486 | }, 1487 | "wc_product_weight_enabled": { 1488 | "prefix": "wc_product_weight_enabled", 1489 | "body": "wc_product_weight_enabled()", 1490 | "description": "Returns whether or not product weights are enabled." 1491 | }, 1492 | "wc_product_dimensions_enabled": { 1493 | "prefix": "wc_product_dimensions_enabled", 1494 | "body": "wc_product_dimensions_enabled()", 1495 | "description": "Returns whether or not product dimensions (HxWxD) are enabled." 1496 | }, 1497 | "wc_delete_product_transients": { 1498 | "prefix": "wc_delete_product_transients", 1499 | "body": "wc_delete_product_transients( ${1:post_id} )", 1500 | "description": "Clear all transients cache for product data." 1501 | }, 1502 | "wc_get_product_ids_on_sale": { 1503 | "prefix": "wc_get_product_ids_on_sale", 1504 | "body": "wc_get_product_ids_on_sale()", 1505 | "description": "Function that returns an array containing the IDs of the products that are on sale." 1506 | }, 1507 | "wc_get_featured_product_ids": { 1508 | "prefix": "wc_get_featured_product_ids", 1509 | "body": "wc_get_featured_product_ids()", 1510 | "description": "Function that returns an array containing the IDs of the featured products." 1511 | }, 1512 | "wc_product_post_type_link": { 1513 | "prefix": "wc_product_post_type_link", 1514 | "body": "wc_product_post_type_link( ${1:permalink}, ${2:post} )", 1515 | "description": "Filter to allow product_cat in the permalinks for products." 1516 | }, 1517 | "wc_placeholder_img_src": { 1518 | "prefix": "wc_placeholder_img_src", 1519 | "body": "wc_placeholder_img_src( ${1:size} )", 1520 | "description": "Get the placeholder image URL for products etc." 1521 | }, 1522 | "wc_placeholder_img": { 1523 | "prefix": "wc_placeholder_img", 1524 | "body": "wc_placeholder_img( ${1:size} )", 1525 | "description": "Get the placeholder image." 1526 | }, 1527 | "wc_get_formatted_variation": { 1528 | "prefix": "wc_get_formatted_variation", 1529 | "body": "wc_get_formatted_variation( ${1:variation}${2:, ${3:flat}${4:, ${5:include_names}${6:, ${7:skip_attributes_in_name}}}} )", 1530 | "description": "Variation Formatting." 1531 | }, 1532 | "wc_scheduled_sales": { 1533 | "prefix": "wc_scheduled_sales", 1534 | "body": "wc_scheduled_sales()", 1535 | "description": "Function which handles the start and end of scheduled sales via cron." 1536 | }, 1537 | "wc_get_attachment_image_attributes": { 1538 | "prefix": "wc_get_attachment_image_attributes", 1539 | "body": "wc_get_attachment_image_attributes( ${1:attr} )", 1540 | "description": "Get attachment image attributes." 1541 | }, 1542 | "wc_prepare_attachment_for_js": { 1543 | "prefix": "wc_prepare_attachment_for_js", 1544 | "body": "wc_prepare_attachment_for_js( ${1:response} )", 1545 | "description": "Prepare attachment for JavaScript." 1546 | }, 1547 | "wc_track_product_view": { 1548 | "prefix": "wc_track_product_view", 1549 | "body": "wc_track_product_view()", 1550 | "description": "Track product views." 1551 | }, 1552 | "wc_get_product_types": { 1553 | "prefix": "wc_get_product_types", 1554 | "body": "wc_get_product_types()", 1555 | "description": "Get product types." 1556 | }, 1557 | "wc_product_has_unique_sku": { 1558 | "prefix": "wc_product_has_unique_sku", 1559 | "body": "wc_product_has_unique_sku( ${1:product_id}, ${2:sku} )", 1560 | "description": "Check if product sku is unique." 1561 | }, 1562 | "wc_product_force_unique_sku": { 1563 | "prefix": "wc_product_force_unique_sku", 1564 | "body": "wc_product_force_unique_sku( ${1:product_id} )", 1565 | "description": "Force a unique SKU." 1566 | }, 1567 | "wc_product_generate_unique_sku": { 1568 | "prefix": "wc_product_generate_unique_sku", 1569 | "body": "wc_product_generate_unique_sku( ${1:product_id}, ${2:sku}${3:, ${4:index}} )", 1570 | "description": "Recursively appends a suffix until a unique SKU is found." 1571 | }, 1572 | "wc_get_product_id_by_sku": { 1573 | "prefix": "wc_get_product_id_by_sku", 1574 | "body": "wc_get_product_id_by_sku( ${1:sku} )", 1575 | "description": "Get product ID by SKU." 1576 | }, 1577 | "wc_get_product_variation_attributes": { 1578 | "prefix": "wc_get_product_variation_attributes", 1579 | "body": "wc_get_product_variation_attributes( ${1:variation_id} )", 1580 | "description": "Get attibutes\/data for an individual variation from the database and maintain it's integrity." 1581 | }, 1582 | "wc_get_product_cat_ids": { 1583 | "prefix": "wc_get_product_cat_ids", 1584 | "body": "wc_get_product_cat_ids( ${1:product_id} )", 1585 | "description": "Get all product cats for a product by ID, including hierarchy" 1586 | }, 1587 | "wc_get_product_attachment_props": { 1588 | "prefix": "wc_get_product_attachment_props", 1589 | "body": "wc_get_product_attachment_props( ${1:${2:attachment_id}${3:, ${4:product}}} )", 1590 | "description": "Gets data about an attachment, such as alt text and captions." 1591 | }, 1592 | "wc_get_product_visibility_options": { 1593 | "prefix": "wc_get_product_visibility_options", 1594 | "body": "wc_get_product_visibility_options()", 1595 | "description": "Get product visibility options." 1596 | }, 1597 | "wc_get_min_max_price_meta_query": { 1598 | "prefix": "wc_get_min_max_price_meta_query", 1599 | "body": "wc_get_min_max_price_meta_query( ${1:args} )", 1600 | "description": "Get min\/max price meta query args." 1601 | }, 1602 | "wc_get_product_tax_class_options": { 1603 | "prefix": "wc_get_product_tax_class_options", 1604 | "body": "wc_get_product_tax_class_options()", 1605 | "description": "Get product tax class options." 1606 | }, 1607 | "wc_get_product_stock_status_options": { 1608 | "prefix": "wc_get_product_stock_status_options", 1609 | "body": "wc_get_product_stock_status_options()", 1610 | "description": "Get stock status options." 1611 | }, 1612 | "wc_get_product_backorder_options": { 1613 | "prefix": "wc_get_product_backorder_options", 1614 | "body": "wc_get_product_backorder_options()", 1615 | "description": "Get backorder options." 1616 | }, 1617 | "wc_get_related_products": { 1618 | "prefix": "wc_get_related_products", 1619 | "body": "wc_get_related_products( ${1:product_id}${2:, ${3:limit}${4:, ${5:exclude_ids}}} )", 1620 | "description": "Get related products based on product category and tags." 1621 | }, 1622 | "wc_get_product_term_ids": { 1623 | "prefix": "wc_get_product_term_ids", 1624 | "body": "wc_get_product_term_ids( ${1:product_id}, ${2:taxonomy} )", 1625 | "description": "Retrieves product term ids for a taxonomy." 1626 | }, 1627 | "wc_get_price_including_tax": { 1628 | "prefix": "wc_get_price_including_tax", 1629 | "body": "wc_get_price_including_tax( ${1:product}${2:, ${3:args}} )", 1630 | "description": "For a given product, and optionally price\/qty, work out the price with tax included, based on store settings." 1631 | }, 1632 | "wc_get_price_excluding_tax": { 1633 | "prefix": "wc_get_price_excluding_tax", 1634 | "body": "wc_get_price_excluding_tax( ${1:product}${2:, ${3:args}} )", 1635 | "description": "For a given product, and optionally price\/qty, work out the price with tax excluded, based on store settings." 1636 | }, 1637 | "wc_get_price_to_display": { 1638 | "prefix": "wc_get_price_to_display", 1639 | "body": "wc_get_price_to_display( ${1:product}${2:, ${3:args}} )", 1640 | "description": "Returns the price including or excluding tax, based on the 'woocommerce_tax_display_shop' setting." 1641 | }, 1642 | "wc_get_product_category_list": { 1643 | "prefix": "wc_get_product_category_list", 1644 | "body": "wc_get_product_category_list( ${1:product_id}${2:, ${3:sep}${4:, ${5:before}${6:, ${7:after}}}} )", 1645 | "description": "Returns the product categories in a list." 1646 | }, 1647 | "wc_get_product_tag_list": { 1648 | "prefix": "wc_get_product_tag_list", 1649 | "body": "wc_get_product_tag_list( ${1:product_id}${2:, ${3:sep}${4:, ${5:before}${6:, ${7:after}}}} )", 1650 | "description": "Returns the product tags in a list." 1651 | }, 1652 | "wc_products_array_filter_visible": { 1653 | "prefix": "wc_products_array_filter_visible", 1654 | "body": "wc_products_array_filter_visible( ${1:product} )", 1655 | "description": "Callback for array filter to get visible only." 1656 | }, 1657 | "wc_products_array_filter_visible_grouped": { 1658 | "prefix": "wc_products_array_filter_visible_grouped", 1659 | "body": "wc_products_array_filter_visible_grouped( ${1:product} )", 1660 | "description": "Callback for array filter to get visible grouped products only." 1661 | }, 1662 | "wc_products_array_filter_editable": { 1663 | "prefix": "wc_products_array_filter_editable", 1664 | "body": "wc_products_array_filter_editable( ${1:product} )", 1665 | "description": "Callback for array filter to get products the user can edit only." 1666 | }, 1667 | "wc_products_array_filter_readable": { 1668 | "prefix": "wc_products_array_filter_readable", 1669 | "body": "wc_products_array_filter_readable( ${1:product} )", 1670 | "description": "Callback for array filter to get products the user can view only." 1671 | }, 1672 | "wc_products_array_orderby": { 1673 | "prefix": "wc_products_array_orderby", 1674 | "body": "wc_products_array_orderby( ${1:products}${2:, ${3:orderby}${4:, ${5:order}}} )", 1675 | "description": "Sort an array of products by a value." 1676 | }, 1677 | "wc_products_array_orderby_title": { 1678 | "prefix": "wc_products_array_orderby_title", 1679 | "body": "wc_products_array_orderby_title( ${1:a}, ${2:b} )", 1680 | "description": "Sort by title." 1681 | }, 1682 | "wc_products_array_orderby_id": { 1683 | "prefix": "wc_products_array_orderby_id", 1684 | "body": "wc_products_array_orderby_id( ${1:a}, ${2:b} )", 1685 | "description": "Sort by id." 1686 | }, 1687 | "wc_products_array_orderby_date": { 1688 | "prefix": "wc_products_array_orderby_date", 1689 | "body": "wc_products_array_orderby_date( ${1:a}, ${2:b} )", 1690 | "description": "Sort by date." 1691 | }, 1692 | "wc_products_array_orderby_modified": { 1693 | "prefix": "wc_products_array_orderby_modified", 1694 | "body": "wc_products_array_orderby_modified( ${1:a}, ${2:b} )", 1695 | "description": "Sort by modified." 1696 | }, 1697 | "wc_products_array_orderby_menu_order": { 1698 | "prefix": "wc_products_array_orderby_menu_order", 1699 | "body": "wc_products_array_orderby_menu_order( ${1:a}, ${2:b} )", 1700 | "description": "Sort by menu order." 1701 | }, 1702 | "wc_products_array_orderby_price": { 1703 | "prefix": "wc_products_array_orderby_price", 1704 | "body": "wc_products_array_orderby_price( ${1:a}, ${2:b} )", 1705 | "description": "Sort by price low to high." 1706 | }, 1707 | "wc_deferred_product_sync": { 1708 | "prefix": "wc_deferred_product_sync", 1709 | "body": "wc_deferred_product_sync( ${1:product_id} )", 1710 | "description": "Queue a product for syncing at the end of the request." 1711 | }, 1712 | "wc_rest_prepare_date_response": { 1713 | "prefix": "wc_rest_prepare_date_response", 1714 | "body": "wc_rest_prepare_date_response( ${1:date}${2:, ${3:utc}} )", 1715 | "description": "Parses and formats a date for ISO8601\/RFC3339." 1716 | }, 1717 | "wc_rest_allowed_image_mime_types": { 1718 | "prefix": "wc_rest_allowed_image_mime_types", 1719 | "body": "wc_rest_allowed_image_mime_types()", 1720 | "description": "Returns image mime types users are allowed to upload via the API." 1721 | }, 1722 | "wc_rest_upload_image_from_url": { 1723 | "prefix": "wc_rest_upload_image_from_url", 1724 | "body": "wc_rest_upload_image_from_url( ${1:image_url} )", 1725 | "description": "Upload image from URL." 1726 | }, 1727 | "wc_rest_set_uploaded_image_as_attachment": { 1728 | "prefix": "wc_rest_set_uploaded_image_as_attachment", 1729 | "body": "wc_rest_set_uploaded_image_as_attachment( ${1:upload}${2:, ${3:id}} )", 1730 | "description": "Set uploaded image as attachment." 1731 | }, 1732 | "wc_rest_validate_reports_request_arg": { 1733 | "prefix": "wc_rest_validate_reports_request_arg", 1734 | "body": "wc_rest_validate_reports_request_arg( ${1:value}, ${2:request}, ${3:param} )", 1735 | "description": "Validate reports request arguments." 1736 | }, 1737 | "wc_rest_urlencode_rfc3986": { 1738 | "prefix": "wc_rest_urlencode_rfc3986", 1739 | "body": "wc_rest_urlencode_rfc3986( ${1:value} )", 1740 | "description": "Encodes a value according to RFC 3986." 1741 | }, 1742 | "wc_rest_check_post_permissions": { 1743 | "prefix": "wc_rest_check_post_permissions", 1744 | "body": "wc_rest_check_post_permissions( ${1:post_type}${2:, ${3:context}${4:, ${5:object_id}}} )", 1745 | "description": "Check permissions of posts on REST API." 1746 | }, 1747 | "wc_rest_check_user_permissions": { 1748 | "prefix": "wc_rest_check_user_permissions", 1749 | "body": "wc_rest_check_user_permissions( ${1:${2:context}${3:, ${4:object_id}}} )", 1750 | "description": "Check permissions of users on REST API." 1751 | }, 1752 | "wc_rest_check_product_term_permissions": { 1753 | "prefix": "wc_rest_check_product_term_permissions", 1754 | "body": "wc_rest_check_product_term_permissions( ${1:taxonomy}${2:, ${3:context}${4:, ${5:object_id}}} )", 1755 | "description": "Check permissions of product terms on REST API." 1756 | }, 1757 | "wc_rest_check_manager_permissions": { 1758 | "prefix": "wc_rest_check_manager_permissions", 1759 | "body": "wc_rest_check_manager_permissions( ${1:object}${2:, ${3:context}} )", 1760 | "description": "Check manager permissions on REST API." 1761 | }, 1762 | "wc_rest_check_product_reviews_permissions": { 1763 | "prefix": "wc_rest_check_product_reviews_permissions", 1764 | "body": "wc_rest_check_product_reviews_permissions( ${1:${2:context}${3:, ${4:object_id}}} )", 1765 | "description": "Check product reviews permissions on REST API." 1766 | }, 1767 | "wc_update_product_stock": { 1768 | "prefix": "wc_update_product_stock", 1769 | "body": "wc_update_product_stock( ${1:product}${2:, ${3:stock_quantity}${4:, ${5:operation}}} )", 1770 | "description": "Update a product's stock amount." 1771 | }, 1772 | "wc_update_product_stock_status": { 1773 | "prefix": "wc_update_product_stock_status", 1774 | "body": "wc_update_product_stock_status( ${1:product_id}, ${2:status} )", 1775 | "description": "Update a product's stock status." 1776 | }, 1777 | "wc_maybe_reduce_stock_levels": { 1778 | "prefix": "wc_maybe_reduce_stock_levels", 1779 | "body": "wc_maybe_reduce_stock_levels( ${1:order_id} )", 1780 | "description": "When a payment is complete, we can reduce stock levels for items within an order." 1781 | }, 1782 | "wc_maybe_increase_stock_levels": { 1783 | "prefix": "wc_maybe_increase_stock_levels", 1784 | "body": "wc_maybe_increase_stock_levels( ${1:order_id} )", 1785 | "description": "When a payment is cancelled, restore stock." 1786 | }, 1787 | "wc_reduce_stock_levels": { 1788 | "prefix": "wc_reduce_stock_levels", 1789 | "body": "wc_reduce_stock_levels( ${1:order_id} )", 1790 | "description": "Reduce stock levels for items within an order, if stock has not already been reduced for the items." 1791 | }, 1792 | "wc_trigger_stock_change_notifications": { 1793 | "prefix": "wc_trigger_stock_change_notifications", 1794 | "body": "wc_trigger_stock_change_notifications( ${1:order}, ${2:changes} )", 1795 | "description": "After stock change events, triggers emails and adds order notes." 1796 | }, 1797 | "wc_increase_stock_levels": { 1798 | "prefix": "wc_increase_stock_levels", 1799 | "body": "wc_increase_stock_levels( ${1:order_id} )", 1800 | "description": "Increase stock levels for items within an order." 1801 | }, 1802 | "wc_get_held_stock_quantity": { 1803 | "prefix": "wc_get_held_stock_quantity", 1804 | "body": "wc_get_held_stock_quantity( ${1:product}${2:, ${3:exclude_order_id}} )", 1805 | "description": "See how much stock is being held in pending orders." 1806 | }, 1807 | "wc_get_low_stock_amount": { 1808 | "prefix": "wc_get_low_stock_amount", 1809 | "body": "wc_get_low_stock_amount( ${1:WC_Product product} )", 1810 | "description": "Return low stock amount to determine if notification needs to be sent" 1811 | }, 1812 | "wc_template_redirect": { 1813 | "prefix": "wc_template_redirect", 1814 | "body": "wc_template_redirect()", 1815 | "description": "Handle redirects before content is output - hooked into template_redirect so is_page works." 1816 | }, 1817 | "wc_send_frame_options_header": { 1818 | "prefix": "wc_send_frame_options_header", 1819 | "body": "wc_send_frame_options_header()", 1820 | "description": "When loading sensitive checkout or account pages, send a HTTP header to limit rendering of pages to same origin iframes for security reasons." 1821 | }, 1822 | "wc_prevent_endpoint_indexing": { 1823 | "prefix": "wc_prevent_endpoint_indexing", 1824 | "body": "wc_prevent_endpoint_indexing()", 1825 | "description": "No index our endpoints." 1826 | }, 1827 | "wc_prevent_adjacent_posts_rel_link_wp_head": { 1828 | "prefix": "wc_prevent_adjacent_posts_rel_link_wp_head", 1829 | "body": "wc_prevent_adjacent_posts_rel_link_wp_head()", 1830 | "description": "Remove adjacent_posts_rel_link_wp_head - pointless for products." 1831 | }, 1832 | "wc_gallery_noscript": { 1833 | "prefix": "wc_gallery_noscript", 1834 | "body": "wc_gallery_noscript()", 1835 | "description": "Show the gallery if JS is disabled." 1836 | }, 1837 | "wc_setup_product_data": { 1838 | "prefix": "wc_setup_product_data", 1839 | "body": "wc_setup_product_data( ${1:post} )", 1840 | "description": "When the_post is called, put product data into a global." 1841 | }, 1842 | "wc_setup_loop": { 1843 | "prefix": "wc_setup_loop", 1844 | "body": "wc_setup_loop( ${1:args} )", 1845 | "description": "Sets up the woocommerce_loop global from the passed args or from the main query." 1846 | }, 1847 | "wc_reset_loop": { 1848 | "prefix": "wc_reset_loop", 1849 | "body": "wc_reset_loop()", 1850 | "description": "Resets the woocommerce_loop global." 1851 | }, 1852 | "wc_get_loop_prop": { 1853 | "prefix": "wc_get_loop_prop", 1854 | "body": "wc_get_loop_prop( ${1:prop}${2:, ${3:default}} )", 1855 | "description": "Gets a property from the woocommerce_loop global." 1856 | }, 1857 | "wc_set_loop_prop": { 1858 | "prefix": "wc_set_loop_prop", 1859 | "body": "wc_set_loop_prop( ${1:prop}${2:, ${3:value}} )", 1860 | "description": "Sets a property in the woocommerce_loop global." 1861 | }, 1862 | "woocommerce_product_loop": { 1863 | "prefix": "woocommerce_product_loop", 1864 | "body": "woocommerce_product_loop()", 1865 | "description": "Should the WooCommerce loop be displayed?" 1866 | }, 1867 | "wc_generator_tag": { 1868 | "prefix": "wc_generator_tag", 1869 | "body": "wc_generator_tag( ${1:gen}, ${2:type} )", 1870 | "description": "Output generator tag to aid debugging." 1871 | }, 1872 | "wc_body_class": { 1873 | "prefix": "wc_body_class", 1874 | "body": "wc_body_class( ${1:classes} )", 1875 | "description": "Add body classes for WC pages." 1876 | }, 1877 | "wc_no_js": { 1878 | "prefix": "wc_no_js", 1879 | "body": "wc_no_js()", 1880 | "description": "NO JS handling." 1881 | }, 1882 | "wc_product_cat_class": { 1883 | "prefix": "wc_product_cat_class", 1884 | "body": "wc_product_cat_class( ${1:${2:class}${3:, ${4:category}}} )", 1885 | "description": "Display the classes for the product cat div." 1886 | }, 1887 | "wc_get_default_products_per_row": { 1888 | "prefix": "wc_get_default_products_per_row", 1889 | "body": "wc_get_default_products_per_row()", 1890 | "description": "Get the default columns setting - this is how many products will be shown per row in loops." 1891 | }, 1892 | "wc_get_default_product_rows_per_page": { 1893 | "prefix": "wc_get_default_product_rows_per_page", 1894 | "body": "wc_get_default_product_rows_per_page()", 1895 | "description": "Get the default rows setting - this is how many product rows will be shown in loops." 1896 | }, 1897 | "wc_reset_product_grid_settings": { 1898 | "prefix": "wc_reset_product_grid_settings", 1899 | "body": "wc_reset_product_grid_settings()", 1900 | "description": "Reset the product grid settings when a new theme is activated." 1901 | }, 1902 | "wc_get_loop_class": { 1903 | "prefix": "wc_get_loop_class", 1904 | "body": "wc_get_loop_class()", 1905 | "description": "Get classname for woocommerce loops." 1906 | }, 1907 | "wc_get_product_cat_class": { 1908 | "prefix": "wc_get_product_cat_class", 1909 | "body": "wc_get_product_cat_class( ${1:${2:class}${3:, ${4:category}}} )", 1910 | "description": "Get the classes for the product cat div." 1911 | }, 1912 | "wc_product_post_class": { 1913 | "prefix": "wc_product_post_class", 1914 | "body": "wc_product_post_class( ${1:classes}${2:, ${3:class}${4:, ${5:post_id}}} )", 1915 | "description": "Adds extra post classes for products." 1916 | }, 1917 | "wc_get_product_taxonomy_class": { 1918 | "prefix": "wc_get_product_taxonomy_class", 1919 | "body": "wc_get_product_taxonomy_class( ${1:term_ids}, ${2:taxonomy} )", 1920 | "description": "Get product taxonomy HTML classes." 1921 | }, 1922 | "wc_get_product_class": { 1923 | "prefix": "wc_get_product_class", 1924 | "body": "wc_get_product_class( ${1:${2:class}${3:, ${4:product_id}}} )", 1925 | "description": "Retrieves the classes for the post div as an array." 1926 | }, 1927 | "wc_product_class": { 1928 | "prefix": "wc_product_class", 1929 | "body": "wc_product_class( ${1:${2:class}${3:, ${4:product_id}}} )", 1930 | "description": "Display the classes for the product div." 1931 | }, 1932 | "wc_query_string_form_fields": { 1933 | "prefix": "wc_query_string_form_fields", 1934 | "body": "wc_query_string_form_fields( ${1:${2:values}${3:, ${4:exclude}${5:, ${6:current_key}${7:, ${8:return}}}}} )", 1935 | "description": "Outputs hidden form inputs for each query string variable." 1936 | }, 1937 | "wc_terms_and_conditions_page_id": { 1938 | "prefix": "wc_terms_and_conditions_page_id", 1939 | "body": "wc_terms_and_conditions_page_id()", 1940 | "description": "Get the terms and conditons page ID." 1941 | }, 1942 | "wc_privacy_policy_page_id": { 1943 | "prefix": "wc_privacy_policy_page_id", 1944 | "body": "wc_privacy_policy_page_id()", 1945 | "description": "Get the privacy policy page ID." 1946 | }, 1947 | "wc_terms_and_conditions_checkbox_enabled": { 1948 | "prefix": "wc_terms_and_conditions_checkbox_enabled", 1949 | "body": "wc_terms_and_conditions_checkbox_enabled()", 1950 | "description": "See if the checkbox is enabled or not based on the existance of the terms page and checkbox text." 1951 | }, 1952 | "wc_get_terms_and_conditions_checkbox_text": { 1953 | "prefix": "wc_get_terms_and_conditions_checkbox_text", 1954 | "body": "wc_get_terms_and_conditions_checkbox_text()", 1955 | "description": "Get the terms and conditons checkbox text, if set." 1956 | }, 1957 | "wc_get_privacy_policy_text": { 1958 | "prefix": "wc_get_privacy_policy_text", 1959 | "body": "wc_get_privacy_policy_text( ${1:type} )", 1960 | "description": "Get the privacy policy text, if set." 1961 | }, 1962 | "wc_terms_and_conditions_checkbox_text": { 1963 | "prefix": "wc_terms_and_conditions_checkbox_text", 1964 | "body": "wc_terms_and_conditions_checkbox_text()", 1965 | "description": "Output t&c checkbox text." 1966 | }, 1967 | "wc_terms_and_conditions_page_content": { 1968 | "prefix": "wc_terms_and_conditions_page_content", 1969 | "body": "wc_terms_and_conditions_page_content()", 1970 | "description": "Output t&c page's content (if set). The page can be set from checkout settings." 1971 | }, 1972 | "wc_checkout_privacy_policy_text": { 1973 | "prefix": "wc_checkout_privacy_policy_text", 1974 | "body": "wc_checkout_privacy_policy_text()", 1975 | "description": "Render privacy policy text on the checkout." 1976 | }, 1977 | "wc_registration_privacy_policy_text": { 1978 | "prefix": "wc_registration_privacy_policy_text", 1979 | "body": "wc_registration_privacy_policy_text()", 1980 | "description": "Render privacy policy text on the register forms." 1981 | }, 1982 | "wc_privacy_policy_text": { 1983 | "prefix": "wc_privacy_policy_text", 1984 | "body": "wc_privacy_policy_text( ${1:type} )", 1985 | "description": "Output privacy policy text. This is custom text which can be added via the customizer\/privacy settings section." 1986 | }, 1987 | "wc_replace_policy_page_link_placeholders": { 1988 | "prefix": "wc_replace_policy_page_link_placeholders", 1989 | "body": "wc_replace_policy_page_link_placeholders( ${1:text} )", 1990 | "description": "Replaces placeholders with links to WooCommerce policy pages." 1991 | }, 1992 | "woocommerce_content": { 1993 | "prefix": "woocommerce_content", 1994 | "body": "woocommerce_content()", 1995 | "description": "Output WooCommerce content." 1996 | }, 1997 | "woocommerce_output_content_wrapper": { 1998 | "prefix": "woocommerce_output_content_wrapper", 1999 | "body": "woocommerce_output_content_wrapper()", 2000 | "description": "Output the start of the page wrapper." 2001 | }, 2002 | "woocommerce_output_content_wrapper_end": { 2003 | "prefix": "woocommerce_output_content_wrapper_end", 2004 | "body": "woocommerce_output_content_wrapper_end()", 2005 | "description": "Output the end of the page wrapper." 2006 | }, 2007 | "woocommerce_get_sidebar": { 2008 | "prefix": "woocommerce_get_sidebar", 2009 | "body": "woocommerce_get_sidebar()", 2010 | "description": "Get the shop sidebar template." 2011 | }, 2012 | "woocommerce_demo_store": { 2013 | "prefix": "woocommerce_demo_store", 2014 | "body": "woocommerce_demo_store()", 2015 | "description": "Adds a demo store banner to the site if enabled." 2016 | }, 2017 | "woocommerce_page_title": { 2018 | "prefix": "woocommerce_page_title", 2019 | "body": "woocommerce_page_title( ${1:echo} )", 2020 | "description": "Page Title function." 2021 | }, 2022 | "woocommerce_product_loop_start": { 2023 | "prefix": "woocommerce_product_loop_start", 2024 | "body": "woocommerce_product_loop_start( ${1:echo} )", 2025 | "description": "Output the start of a product loop. By default this is a UL." 2026 | }, 2027 | "woocommerce_product_loop_end": { 2028 | "prefix": "woocommerce_product_loop_end", 2029 | "body": "woocommerce_product_loop_end( ${1:echo} )", 2030 | "description": "Output the end of a product loop. By default this is a UL." 2031 | }, 2032 | "woocommerce_template_loop_product_title": { 2033 | "prefix": "woocommerce_template_loop_product_title", 2034 | "body": "woocommerce_template_loop_product_title()", 2035 | "description": "Show the product title in the product loop. By default this is an H2." 2036 | }, 2037 | "woocommerce_template_loop_category_title": { 2038 | "prefix": "woocommerce_template_loop_category_title", 2039 | "body": "woocommerce_template_loop_category_title( ${1:category} )", 2040 | "description": "Show the subcategory title in the product loop." 2041 | }, 2042 | "woocommerce_template_loop_product_link_open": { 2043 | "prefix": "woocommerce_template_loop_product_link_open", 2044 | "body": "woocommerce_template_loop_product_link_open()", 2045 | "description": "Insert the opening anchor tag for products in the loop." 2046 | }, 2047 | "woocommerce_template_loop_product_link_close": { 2048 | "prefix": "woocommerce_template_loop_product_link_close", 2049 | "body": "woocommerce_template_loop_product_link_close()", 2050 | "description": "Insert the opening anchor tag for products in the loop." 2051 | }, 2052 | "woocommerce_template_loop_category_link_open": { 2053 | "prefix": "woocommerce_template_loop_category_link_open", 2054 | "body": "woocommerce_template_loop_category_link_open( ${1:category} )", 2055 | "description": "Insert the opening anchor tag for categories in the loop." 2056 | }, 2057 | "woocommerce_template_loop_category_link_close": { 2058 | "prefix": "woocommerce_template_loop_category_link_close", 2059 | "body": "woocommerce_template_loop_category_link_close()", 2060 | "description": "Insert the closing anchor tag for categories in the loop." 2061 | }, 2062 | "woocommerce_taxonomy_archive_description": { 2063 | "prefix": "woocommerce_taxonomy_archive_description", 2064 | "body": "woocommerce_taxonomy_archive_description()", 2065 | "description": "Show an archive description on taxonomy archives." 2066 | }, 2067 | "woocommerce_product_archive_description": { 2068 | "prefix": "woocommerce_product_archive_description", 2069 | "body": "woocommerce_product_archive_description()", 2070 | "description": "Show a shop page description on product archives." 2071 | }, 2072 | "woocommerce_template_loop_add_to_cart": { 2073 | "prefix": "woocommerce_template_loop_add_to_cart", 2074 | "body": "woocommerce_template_loop_add_to_cart( ${1:args} )", 2075 | "description": "Get the add to cart template for the loop." 2076 | }, 2077 | "woocommerce_template_loop_product_thumbnail": { 2078 | "prefix": "woocommerce_template_loop_product_thumbnail", 2079 | "body": "woocommerce_template_loop_product_thumbnail()", 2080 | "description": "Get the product thumbnail for the loop." 2081 | }, 2082 | "woocommerce_template_loop_price": { 2083 | "prefix": "woocommerce_template_loop_price", 2084 | "body": "woocommerce_template_loop_price()", 2085 | "description": "Get the product price for the loop." 2086 | }, 2087 | "woocommerce_template_loop_rating": { 2088 | "prefix": "woocommerce_template_loop_rating", 2089 | "body": "woocommerce_template_loop_rating()", 2090 | "description": "Display the average rating in the loop." 2091 | }, 2092 | "woocommerce_show_product_loop_sale_flash": { 2093 | "prefix": "woocommerce_show_product_loop_sale_flash", 2094 | "body": "woocommerce_show_product_loop_sale_flash()", 2095 | "description": "Get the sale flash for the loop." 2096 | }, 2097 | "woocommerce_get_product_thumbnail": { 2098 | "prefix": "woocommerce_get_product_thumbnail", 2099 | "body": "woocommerce_get_product_thumbnail( ${1:${2:size}${3:, ${4:deprecated1}${5:, ${6:deprecated2}}}} )", 2100 | "description": "Get the product thumbnail, or the placeholder if not set." 2101 | }, 2102 | "woocommerce_result_count": { 2103 | "prefix": "woocommerce_result_count", 2104 | "body": "woocommerce_result_count()", 2105 | "description": "Output the result count text (Showing x - x of x results)." 2106 | }, 2107 | "woocommerce_catalog_ordering": { 2108 | "prefix": "woocommerce_catalog_ordering", 2109 | "body": "woocommerce_catalog_ordering()", 2110 | "description": "Output the product sorting options." 2111 | }, 2112 | "woocommerce_pagination": { 2113 | "prefix": "woocommerce_pagination", 2114 | "body": "woocommerce_pagination()", 2115 | "description": "Output the pagination." 2116 | }, 2117 | "woocommerce_show_product_images": { 2118 | "prefix": "woocommerce_show_product_images", 2119 | "body": "woocommerce_show_product_images()", 2120 | "description": "Output the product image before the single product summary." 2121 | }, 2122 | "woocommerce_show_product_thumbnails": { 2123 | "prefix": "woocommerce_show_product_thumbnails", 2124 | "body": "woocommerce_show_product_thumbnails()", 2125 | "description": "Output the product thumbnails." 2126 | }, 2127 | "wc_get_gallery_image_html": { 2128 | "prefix": "wc_get_gallery_image_html", 2129 | "body": "wc_get_gallery_image_html( ${1:attachment_id}${2:, ${3:main_image}} )", 2130 | "description": "Get HTML for a gallery image." 2131 | }, 2132 | "woocommerce_output_product_data_tabs": { 2133 | "prefix": "woocommerce_output_product_data_tabs", 2134 | "body": "woocommerce_output_product_data_tabs()", 2135 | "description": "Output the product tabs." 2136 | }, 2137 | "woocommerce_template_single_title": { 2138 | "prefix": "woocommerce_template_single_title", 2139 | "body": "woocommerce_template_single_title()", 2140 | "description": "Output the product title." 2141 | }, 2142 | "woocommerce_template_single_rating": { 2143 | "prefix": "woocommerce_template_single_rating", 2144 | "body": "woocommerce_template_single_rating()", 2145 | "description": "Output the product rating." 2146 | }, 2147 | "woocommerce_template_single_price": { 2148 | "prefix": "woocommerce_template_single_price", 2149 | "body": "woocommerce_template_single_price()", 2150 | "description": "Output the product price." 2151 | }, 2152 | "woocommerce_template_single_excerpt": { 2153 | "prefix": "woocommerce_template_single_excerpt", 2154 | "body": "woocommerce_template_single_excerpt()", 2155 | "description": "Output the product short description (excerpt)." 2156 | }, 2157 | "woocommerce_template_single_meta": { 2158 | "prefix": "woocommerce_template_single_meta", 2159 | "body": "woocommerce_template_single_meta()", 2160 | "description": "Output the product meta." 2161 | }, 2162 | "woocommerce_template_single_sharing": { 2163 | "prefix": "woocommerce_template_single_sharing", 2164 | "body": "woocommerce_template_single_sharing()", 2165 | "description": "Output the product sharing." 2166 | }, 2167 | "woocommerce_show_product_sale_flash": { 2168 | "prefix": "woocommerce_show_product_sale_flash", 2169 | "body": "woocommerce_show_product_sale_flash()", 2170 | "description": "Output the product sale flash." 2171 | }, 2172 | "woocommerce_template_single_add_to_cart": { 2173 | "prefix": "woocommerce_template_single_add_to_cart", 2174 | "body": "woocommerce_template_single_add_to_cart()", 2175 | "description": "Trigger the single product add to cart action." 2176 | }, 2177 | "woocommerce_simple_add_to_cart": { 2178 | "prefix": "woocommerce_simple_add_to_cart", 2179 | "body": "woocommerce_simple_add_to_cart()", 2180 | "description": "Output the simple product add to cart area." 2181 | }, 2182 | "woocommerce_grouped_add_to_cart": { 2183 | "prefix": "woocommerce_grouped_add_to_cart", 2184 | "body": "woocommerce_grouped_add_to_cart()", 2185 | "description": "Output the grouped product add to cart area." 2186 | }, 2187 | "woocommerce_variable_add_to_cart": { 2188 | "prefix": "woocommerce_variable_add_to_cart", 2189 | "body": "woocommerce_variable_add_to_cart()", 2190 | "description": "Output the variable product add to cart area." 2191 | }, 2192 | "woocommerce_external_add_to_cart": { 2193 | "prefix": "woocommerce_external_add_to_cart", 2194 | "body": "woocommerce_external_add_to_cart()", 2195 | "description": "Output the external product add to cart area." 2196 | }, 2197 | "woocommerce_quantity_input": { 2198 | "prefix": "woocommerce_quantity_input", 2199 | "body": "woocommerce_quantity_input( ${1:${2:args}${3:, ${4:product}${5:, ${6:echo}}}} )", 2200 | "description": "Output the quantity input for add to cart forms." 2201 | }, 2202 | "woocommerce_product_description_tab": { 2203 | "prefix": "woocommerce_product_description_tab", 2204 | "body": "woocommerce_product_description_tab()", 2205 | "description": "Output the description tab content." 2206 | }, 2207 | "woocommerce_product_additional_information_tab": { 2208 | "prefix": "woocommerce_product_additional_information_tab", 2209 | "body": "woocommerce_product_additional_information_tab()", 2210 | "description": "Output the attributes tab content." 2211 | }, 2212 | "woocommerce_default_product_tabs": { 2213 | "prefix": "woocommerce_default_product_tabs", 2214 | "body": "woocommerce_default_product_tabs( ${1:tabs} )", 2215 | "description": "Add default product tabs to product pages." 2216 | }, 2217 | "woocommerce_sort_product_tabs": { 2218 | "prefix": "woocommerce_sort_product_tabs", 2219 | "body": "woocommerce_sort_product_tabs( ${1:tabs} )", 2220 | "description": "Sort tabs by priority." 2221 | }, 2222 | "_sort_priority_callback": { 2223 | "prefix": "_sort_priority_callback", 2224 | "body": "_sort_priority_callback( ${1:a}, ${2:b} )", 2225 | "description": "Sort Priority Callback Function" 2226 | }, 2227 | "woocommerce_comments": { 2228 | "prefix": "woocommerce_comments", 2229 | "body": "woocommerce_comments( ${1:comment}, ${2:args}, ${3:depth} )", 2230 | "description": "Output the Review comments template." 2231 | }, 2232 | "woocommerce_review_display_gravatar": { 2233 | "prefix": "woocommerce_review_display_gravatar", 2234 | "body": "woocommerce_review_display_gravatar( ${1:comment} )", 2235 | "description": "Display the review authors gravatar" 2236 | }, 2237 | "woocommerce_review_display_rating": { 2238 | "prefix": "woocommerce_review_display_rating", 2239 | "body": "woocommerce_review_display_rating()", 2240 | "description": "Display the reviewers star rating" 2241 | }, 2242 | "woocommerce_review_display_meta": { 2243 | "prefix": "woocommerce_review_display_meta", 2244 | "body": "woocommerce_review_display_meta()", 2245 | "description": "Display the review authors meta (name, verified owner, review date)" 2246 | }, 2247 | "woocommerce_review_display_comment_text": { 2248 | "prefix": "woocommerce_review_display_comment_text", 2249 | "body": "woocommerce_review_display_comment_text()", 2250 | "description": "Display the review content." 2251 | }, 2252 | "woocommerce_output_related_products": { 2253 | "prefix": "woocommerce_output_related_products", 2254 | "body": "woocommerce_output_related_products()", 2255 | "description": "Output the related products." 2256 | }, 2257 | "woocommerce_related_products": { 2258 | "prefix": "woocommerce_related_products", 2259 | "body": "woocommerce_related_products( ${1:args} )", 2260 | "description": "Output the related products." 2261 | }, 2262 | "woocommerce_upsell_display": { 2263 | "prefix": "woocommerce_upsell_display", 2264 | "body": "woocommerce_upsell_display( ${1:${2:limit}${3:, ${4:columns}${5:, ${6:orderby}${7:, ${8:order}}}}} )", 2265 | "description": "Output product up sells." 2266 | }, 2267 | "woocommerce_shipping_calculator": { 2268 | "prefix": "woocommerce_shipping_calculator", 2269 | "body": "woocommerce_shipping_calculator( ${1:button_text} )", 2270 | "description": "Output the cart shipping calculator." 2271 | }, 2272 | "woocommerce_cart_totals": { 2273 | "prefix": "woocommerce_cart_totals", 2274 | "body": "woocommerce_cart_totals()", 2275 | "description": "Output the cart totals." 2276 | }, 2277 | "woocommerce_cross_sell_display": { 2278 | "prefix": "woocommerce_cross_sell_display", 2279 | "body": "woocommerce_cross_sell_display( ${1:${2:limit}${3:, ${4:columns}${5:, ${6:orderby}${7:, ${8:order}}}}} )", 2280 | "description": "Output the cart cross-sells." 2281 | }, 2282 | "woocommerce_button_proceed_to_checkout": { 2283 | "prefix": "woocommerce_button_proceed_to_checkout", 2284 | "body": "woocommerce_button_proceed_to_checkout()", 2285 | "description": "Output the proceed to checkout button." 2286 | }, 2287 | "woocommerce_widget_shopping_cart_button_view_cart": { 2288 | "prefix": "woocommerce_widget_shopping_cart_button_view_cart", 2289 | "body": "woocommerce_widget_shopping_cart_button_view_cart()", 2290 | "description": "Output the view cart button." 2291 | }, 2292 | "woocommerce_widget_shopping_cart_proceed_to_checkout": { 2293 | "prefix": "woocommerce_widget_shopping_cart_proceed_to_checkout", 2294 | "body": "woocommerce_widget_shopping_cart_proceed_to_checkout()", 2295 | "description": "Output the proceed to checkout button." 2296 | }, 2297 | "woocommerce_mini_cart": { 2298 | "prefix": "woocommerce_mini_cart", 2299 | "body": "woocommerce_mini_cart( ${1:args} )", 2300 | "description": "Output the Mini-cart - used by cart widget." 2301 | }, 2302 | "woocommerce_login_form": { 2303 | "prefix": "woocommerce_login_form", 2304 | "body": "woocommerce_login_form( ${1:args} )", 2305 | "description": "Output the WooCommerce Login Form." 2306 | }, 2307 | "woocommerce_checkout_login_form": { 2308 | "prefix": "woocommerce_checkout_login_form", 2309 | "body": "woocommerce_checkout_login_form()", 2310 | "description": "Output the WooCommerce Checkout Login Form." 2311 | }, 2312 | "woocommerce_breadcrumb": { 2313 | "prefix": "woocommerce_breadcrumb", 2314 | "body": "woocommerce_breadcrumb( ${1:args} )", 2315 | "description": "Output the WooCommerce Breadcrumb." 2316 | }, 2317 | "woocommerce_order_review": { 2318 | "prefix": "woocommerce_order_review", 2319 | "body": "woocommerce_order_review( ${1:deprecated} )", 2320 | "description": "Output the Order review table for the checkout." 2321 | }, 2322 | "woocommerce_checkout_payment": { 2323 | "prefix": "woocommerce_checkout_payment", 2324 | "body": "woocommerce_checkout_payment()", 2325 | "description": "Output the Payment Methods on the checkout." 2326 | }, 2327 | "woocommerce_checkout_coupon_form": { 2328 | "prefix": "woocommerce_checkout_coupon_form", 2329 | "body": "woocommerce_checkout_coupon_form()", 2330 | "description": "Output the Coupon form for the checkout." 2331 | }, 2332 | "woocommerce_products_will_display": { 2333 | "prefix": "woocommerce_products_will_display", 2334 | "body": "woocommerce_products_will_display()", 2335 | "description": "Check if we will be showing products or not (and not sub-categories only)." 2336 | }, 2337 | "woocommerce_get_loop_display_mode": { 2338 | "prefix": "woocommerce_get_loop_display_mode", 2339 | "body": "woocommerce_get_loop_display_mode()", 2340 | "description": "See what is going to display in the loop." 2341 | }, 2342 | "woocommerce_maybe_show_product_subcategories": { 2343 | "prefix": "woocommerce_maybe_show_product_subcategories", 2344 | "body": "woocommerce_maybe_show_product_subcategories( ${1:loop_html} )", 2345 | "description": "Maybe display categories before, or instead of, a product loop." 2346 | }, 2347 | "woocommerce_product_subcategories": { 2348 | "prefix": "woocommerce_product_subcategories", 2349 | "body": "woocommerce_product_subcategories( ${1:args} )", 2350 | "description": "This is a legacy function which used to check if we needed to display subcats and then output them. It was called by templates." 2351 | }, 2352 | "woocommerce_output_product_categories": { 2353 | "prefix": "woocommerce_output_product_categories", 2354 | "body": "woocommerce_output_product_categories( ${1:args} )", 2355 | "description": "Display product sub categories as thumbnails." 2356 | }, 2357 | "woocommerce_get_product_subcategories": { 2358 | "prefix": "woocommerce_get_product_subcategories", 2359 | "body": "woocommerce_get_product_subcategories( ${1:parent_id} )", 2360 | "description": "Get (and cache) product subcategories." 2361 | }, 2362 | "woocommerce_subcategory_thumbnail": { 2363 | "prefix": "woocommerce_subcategory_thumbnail", 2364 | "body": "woocommerce_subcategory_thumbnail( ${1:category} )", 2365 | "description": "Show subcategory thumbnails." 2366 | }, 2367 | "woocommerce_order_details_table": { 2368 | "prefix": "woocommerce_order_details_table", 2369 | "body": "woocommerce_order_details_table( ${1:order_id} )", 2370 | "description": "Displays order details in a table." 2371 | }, 2372 | "woocommerce_order_downloads_table": { 2373 | "prefix": "woocommerce_order_downloads_table", 2374 | "body": "woocommerce_order_downloads_table( ${1:downloads} )", 2375 | "description": "Displays order downloads in a table." 2376 | }, 2377 | "woocommerce_order_again_button": { 2378 | "prefix": "woocommerce_order_again_button", 2379 | "body": "woocommerce_order_again_button( ${1:order} )", 2380 | "description": "Display an 'order again' button on the view order page." 2381 | }, 2382 | "woocommerce_form_field": { 2383 | "prefix": "woocommerce_form_field", 2384 | "body": "woocommerce_form_field( ${1:key}, ${2:args}${3:, ${4:value}} )", 2385 | "description": "Outputs a checkout\/address form field." 2386 | }, 2387 | "get_product_search_form": { 2388 | "prefix": "get_product_search_form", 2389 | "body": "get_product_search_form( ${1:echo} )", 2390 | "description": "Display product search form." 2391 | }, 2392 | "woocommerce_output_auth_header": { 2393 | "prefix": "woocommerce_output_auth_header", 2394 | "body": "woocommerce_output_auth_header()", 2395 | "description": "Output the Auth header." 2396 | }, 2397 | "woocommerce_output_auth_footer": { 2398 | "prefix": "woocommerce_output_auth_footer", 2399 | "body": "woocommerce_output_auth_footer()", 2400 | "description": "Output the Auth footer." 2401 | }, 2402 | "woocommerce_single_variation": { 2403 | "prefix": "woocommerce_single_variation", 2404 | "body": "woocommerce_single_variation()", 2405 | "description": "Output placeholders for the single variation." 2406 | }, 2407 | "woocommerce_single_variation_add_to_cart_button": { 2408 | "prefix": "woocommerce_single_variation_add_to_cart_button", 2409 | "body": "woocommerce_single_variation_add_to_cart_button()", 2410 | "description": "Output the add to cart button for variations." 2411 | }, 2412 | "wc_dropdown_variation_attribute_options": { 2413 | "prefix": "wc_dropdown_variation_attribute_options", 2414 | "body": "wc_dropdown_variation_attribute_options( ${1:args} )", 2415 | "description": "Output a list of variation attributes for use in the cart forms." 2416 | }, 2417 | "woocommerce_account_content": { 2418 | "prefix": "woocommerce_account_content", 2419 | "body": "woocommerce_account_content()", 2420 | "description": "My Account content output." 2421 | }, 2422 | "woocommerce_account_navigation": { 2423 | "prefix": "woocommerce_account_navigation", 2424 | "body": "woocommerce_account_navigation()", 2425 | "description": "My Account navigation template." 2426 | }, 2427 | "woocommerce_account_orders": { 2428 | "prefix": "woocommerce_account_orders", 2429 | "body": "woocommerce_account_orders( ${1:current_page} )", 2430 | "description": "My Account > Orders template." 2431 | }, 2432 | "woocommerce_account_view_order": { 2433 | "prefix": "woocommerce_account_view_order", 2434 | "body": "woocommerce_account_view_order( ${1:order_id} )", 2435 | "description": "My Account > View order template." 2436 | }, 2437 | "woocommerce_account_downloads": { 2438 | "prefix": "woocommerce_account_downloads", 2439 | "body": "woocommerce_account_downloads()", 2440 | "description": "My Account > Downloads template." 2441 | }, 2442 | "woocommerce_account_edit_address": { 2443 | "prefix": "woocommerce_account_edit_address", 2444 | "body": "woocommerce_account_edit_address( ${1:type} )", 2445 | "description": "My Account > Edit address template." 2446 | }, 2447 | "woocommerce_account_payment_methods": { 2448 | "prefix": "woocommerce_account_payment_methods", 2449 | "body": "woocommerce_account_payment_methods()", 2450 | "description": "My Account > Downloads template." 2451 | }, 2452 | "woocommerce_account_add_payment_method": { 2453 | "prefix": "woocommerce_account_add_payment_method", 2454 | "body": "woocommerce_account_add_payment_method()", 2455 | "description": "My Account > Add payment method template." 2456 | }, 2457 | "woocommerce_account_edit_account": { 2458 | "prefix": "woocommerce_account_edit_account", 2459 | "body": "woocommerce_account_edit_account()", 2460 | "description": "My Account > Edit account template." 2461 | }, 2462 | "wc_no_products_found": { 2463 | "prefix": "wc_no_products_found", 2464 | "body": "wc_no_products_found()", 2465 | "description": "Handles the loop when no products were found\/no product exist." 2466 | }, 2467 | "wc_get_email_order_items": { 2468 | "prefix": "wc_get_email_order_items", 2469 | "body": "wc_get_email_order_items( ${1:order}${2:, ${3:args}} )", 2470 | "description": "Get HTML for the order items to be shown in emails." 2471 | }, 2472 | "wc_display_item_meta": { 2473 | "prefix": "wc_display_item_meta", 2474 | "body": "wc_display_item_meta( ${1:item}${2:, ${3:args}} )", 2475 | "description": "Display item meta data." 2476 | }, 2477 | "wc_display_item_downloads": { 2478 | "prefix": "wc_display_item_downloads", 2479 | "body": "wc_display_item_downloads( ${1:item}${2:, ${3:args}} )", 2480 | "description": "Display item download links." 2481 | }, 2482 | "woocommerce_photoswipe": { 2483 | "prefix": "woocommerce_photoswipe", 2484 | "body": "woocommerce_photoswipe()", 2485 | "description": "Get the shop sidebar template." 2486 | }, 2487 | "wc_display_product_attributes": { 2488 | "prefix": "wc_display_product_attributes", 2489 | "body": "wc_display_product_attributes( ${1:product} )", 2490 | "description": "Outputs a list of product attributes for a product." 2491 | }, 2492 | "wc_get_stock_html": { 2493 | "prefix": "wc_get_stock_html", 2494 | "body": "wc_get_stock_html( ${1:product} )", 2495 | "description": "Get HTML to show product stock." 2496 | }, 2497 | "wc_get_rating_html": { 2498 | "prefix": "wc_get_rating_html", 2499 | "body": "wc_get_rating_html( ${1:rating}${2:, ${3:count}} )", 2500 | "description": "Get HTML for ratings." 2501 | }, 2502 | "wc_get_star_rating_html": { 2503 | "prefix": "wc_get_star_rating_html", 2504 | "body": "wc_get_star_rating_html( ${1:rating}${2:, ${3:count}} )", 2505 | "description": "Get HTML for star rating." 2506 | }, 2507 | "wc_get_price_html_from_text": { 2508 | "prefix": "wc_get_price_html_from_text", 2509 | "body": "wc_get_price_html_from_text()", 2510 | "description": "Returns a 'from' prefix if you want to show where prices start at." 2511 | }, 2512 | "wc_logout_url": { 2513 | "prefix": "wc_logout_url", 2514 | "body": "wc_logout_url( ${1:redirect} )", 2515 | "description": "Get logout endpoint." 2516 | }, 2517 | "wc_empty_cart_message": { 2518 | "prefix": "wc_empty_cart_message", 2519 | "body": "wc_empty_cart_message()", 2520 | "description": "Show notice if cart is empty." 2521 | }, 2522 | "wc_page_noindex": { 2523 | "prefix": "wc_page_noindex", 2524 | "body": "wc_page_noindex()", 2525 | "description": "Disable search engines indexing core, dynamic, cart\/checkout pages." 2526 | }, 2527 | "wc_get_theme_slug_for_templates": { 2528 | "prefix": "wc_get_theme_slug_for_templates", 2529 | "body": "wc_get_theme_slug_for_templates()", 2530 | "description": "Get a slug identifying the current theme." 2531 | }, 2532 | "wc_get_formatted_cart_item_data": { 2533 | "prefix": "wc_get_formatted_cart_item_data", 2534 | "body": "wc_get_formatted_cart_item_data( ${1:cart_item}${2:, ${3:flat}} )", 2535 | "description": "Gets and formats a list of cart item data + variations for display on the frontend." 2536 | }, 2537 | "wc_get_cart_remove_url": { 2538 | "prefix": "wc_get_cart_remove_url", 2539 | "body": "wc_get_cart_remove_url( ${1:cart_item_key} )", 2540 | "description": "Gets the url to remove an item from the cart." 2541 | }, 2542 | "wc_get_cart_undo_url": { 2543 | "prefix": "wc_get_cart_undo_url", 2544 | "body": "wc_get_cart_undo_url( ${1:cart_item_key} )", 2545 | "description": "Gets the url to re-add an item into the cart." 2546 | }, 2547 | "woocommerce_output_all_notices": { 2548 | "prefix": "woocommerce_output_all_notices", 2549 | "body": "woocommerce_output_all_notices()", 2550 | "description": "Outputs all queued notices on WC pages." 2551 | }, 2552 | "wc_products_rss_feed": { 2553 | "prefix": "wc_products_rss_feed", 2554 | "body": "wc_products_rss_feed()", 2555 | "description": "Products RSS Feed." 2556 | }, 2557 | "woocommerce_reset_loop": { 2558 | "prefix": "woocommerce_reset_loop", 2559 | "body": "woocommerce_reset_loop()", 2560 | "description": "Reset the loop's index and columns when we're done outputting a product loop." 2561 | }, 2562 | "woocommerce_product_reviews_tab": { 2563 | "prefix": "woocommerce_product_reviews_tab", 2564 | "body": "woocommerce_product_reviews_tab()", 2565 | "description": "Output the reviews tab content." 2566 | }, 2567 | "wc_get_object_terms": { 2568 | "prefix": "wc_get_object_terms", 2569 | "body": "wc_get_object_terms( ${1:object_id}, ${2:taxonomy}${3:, ${4:field}${5:, ${6:index_key}}} )", 2570 | "description": "Helper to get cached object terms and filter by field using wp_list_pluck()." 2571 | }, 2572 | "_wc_get_cached_product_terms": { 2573 | "prefix": "_wc_get_cached_product_terms", 2574 | "body": "_wc_get_cached_product_terms( ${1:product_id}, ${2:taxonomy}${3:, ${4:args}} )", 2575 | "description": "Cached version of wp_get_post_terms()." 2576 | }, 2577 | "wc_get_product_terms": { 2578 | "prefix": "wc_get_product_terms", 2579 | "body": "wc_get_product_terms( ${1:product_id}, ${2:taxonomy}${3:, ${4:args}} )", 2580 | "description": "Wrapper for wp_get_post_terms which supports ordering by parent." 2581 | }, 2582 | "_wc_get_product_terms_name_num_usort_callback": { 2583 | "prefix": "_wc_get_product_terms_name_num_usort_callback", 2584 | "body": "_wc_get_product_terms_name_num_usort_callback( ${1:a}, ${2:b} )", 2585 | "description": "Sort by name (numeric)." 2586 | }, 2587 | "_wc_get_product_terms_parent_usort_callback": { 2588 | "prefix": "_wc_get_product_terms_parent_usort_callback", 2589 | "body": "_wc_get_product_terms_parent_usort_callback( ${1:a}, ${2:b} )", 2590 | "description": "Sort by parent." 2591 | }, 2592 | "wc_product_dropdown_categories": { 2593 | "prefix": "wc_product_dropdown_categories", 2594 | "body": "wc_product_dropdown_categories( ${1:args} )", 2595 | "description": "WooCommerce Dropdown categories." 2596 | }, 2597 | "wc_walk_category_dropdown_tree": { 2598 | "prefix": "wc_walk_category_dropdown_tree", 2599 | "body": "wc_walk_category_dropdown_tree()", 2600 | "description": "Custom walker for Product Categories." 2601 | }, 2602 | "wc_taxonomy_metadata_update_content_for_split_terms": { 2603 | "prefix": "wc_taxonomy_metadata_update_content_for_split_terms", 2604 | "body": "wc_taxonomy_metadata_update_content_for_split_terms( ${1:old_term_id}, ${2:new_term_id}, ${3:term_taxonomy_id}, ${4:taxonomy} )", 2605 | "description": "When a term is split, ensure meta data maintained." 2606 | }, 2607 | "wc_taxonomy_metadata_migrate_data": { 2608 | "prefix": "wc_taxonomy_metadata_migrate_data", 2609 | "body": "wc_taxonomy_metadata_migrate_data( ${1:wp_db_version}, ${2:wp_current_db_version} )", 2610 | "description": "Migrate data from WC term meta to WP term meta." 2611 | }, 2612 | "update_woocommerce_term_meta": { 2613 | "prefix": "update_woocommerce_term_meta", 2614 | "body": "update_woocommerce_term_meta( ${1:term_id}, ${2:meta_key}, ${3:meta_value}${4:, ${5:prev_value}} )", 2615 | "description": "WooCommerce Term Meta API." 2616 | }, 2617 | "add_woocommerce_term_meta": { 2618 | "prefix": "add_woocommerce_term_meta", 2619 | "body": "add_woocommerce_term_meta( ${1:term_id}, ${2:meta_key}, ${3:meta_value}${4:, ${5:unique}} )", 2620 | "description": "WooCommerce Term Meta API." 2621 | }, 2622 | "delete_woocommerce_term_meta": { 2623 | "prefix": "delete_woocommerce_term_meta", 2624 | "body": "delete_woocommerce_term_meta( ${1:term_id}, ${2:meta_key}${3:, ${4:meta_value}${5:, ${6:deprecated}}} )", 2625 | "description": "WooCommerce Term Meta API" 2626 | }, 2627 | "get_woocommerce_term_meta": { 2628 | "prefix": "get_woocommerce_term_meta", 2629 | "body": "get_woocommerce_term_meta( ${1:term_id}, ${2:key}${3:, ${4:single}} )", 2630 | "description": "WooCommerce Term Meta API" 2631 | }, 2632 | "wc_reorder_terms": { 2633 | "prefix": "wc_reorder_terms", 2634 | "body": "wc_reorder_terms( ${1:the_term}, ${2:next_id}, ${3:taxonomy}${4:, ${5:index}${6:, ${7:terms}}} )", 2635 | "description": "Move a term before the a given element of its hierarchy level." 2636 | }, 2637 | "wc_set_term_order": { 2638 | "prefix": "wc_set_term_order", 2639 | "body": "wc_set_term_order( ${1:term_id}, ${2:index}, ${3:taxonomy}${4:, ${5:recursive}} )", 2640 | "description": "Set the sort order of a term." 2641 | }, 2642 | "wc_terms_clauses": { 2643 | "prefix": "wc_terms_clauses", 2644 | "body": "wc_terms_clauses( ${1:clauses}, ${2:taxonomies}, ${3:args} )", 2645 | "description": "Add term ordering to get_terms." 2646 | }, 2647 | "_wc_term_recount": { 2648 | "prefix": "_wc_term_recount", 2649 | "body": "_wc_term_recount( ${1:terms}, ${2:taxonomy}${3:, ${4:callback}${5:, ${6:terms_are_term_taxonomy_ids}}} )", 2650 | "description": "Function for recounting product terms, ignoring hidden products." 2651 | }, 2652 | "wc_recount_after_stock_change": { 2653 | "prefix": "wc_recount_after_stock_change", 2654 | "body": "wc_recount_after_stock_change( ${1:product_id} )", 2655 | "description": "Recount terms after the stock amount changes." 2656 | }, 2657 | "wc_change_term_counts": { 2658 | "prefix": "wc_change_term_counts", 2659 | "body": "wc_change_term_counts( ${1:terms}, ${2:taxonomies} )", 2660 | "description": "Overrides the original term count for product categories and tags with the product count." 2661 | }, 2662 | "wc_get_term_product_ids": { 2663 | "prefix": "wc_get_term_product_ids", 2664 | "body": "wc_get_term_product_ids( ${1:term_id}, ${2:taxonomy} )", 2665 | "description": "Return products in a given term, and cache value." 2666 | }, 2667 | "wc_clear_term_product_ids": { 2668 | "prefix": "wc_clear_term_product_ids", 2669 | "body": "wc_clear_term_product_ids( ${1:object_id}, ${2:terms}, ${3:tt_ids}, ${4:taxonomy}, ${5:append}, ${6:old_tt_ids} )", 2670 | "description": "When a post is updated and terms recounted (called by _update_post_term_count), clear the ids." 2671 | }, 2672 | "wc_get_product_visibility_term_ids": { 2673 | "prefix": "wc_get_product_visibility_term_ids", 2674 | "body": "wc_get_product_visibility_term_ids()", 2675 | "description": "Get full list of product visibilty term ids." 2676 | }, 2677 | "wc_disable_admin_bar": { 2678 | "prefix": "wc_disable_admin_bar", 2679 | "body": "wc_disable_admin_bar( ${1:show_admin_bar} )", 2680 | "description": "Prevent any user who cannot 'edit_posts' (subscribers, customers etc) from seeing the admin bar." 2681 | }, 2682 | "wc_create_new_customer": { 2683 | "prefix": "wc_create_new_customer", 2684 | "body": "wc_create_new_customer( ${1:email}${2:, ${3:username}${4:, ${5:password}}} )", 2685 | "description": "Create a new customer." 2686 | }, 2687 | "wc_set_customer_auth_cookie": { 2688 | "prefix": "wc_set_customer_auth_cookie", 2689 | "body": "wc_set_customer_auth_cookie( ${1:customer_id} )", 2690 | "description": "Login a customer (set auth cookie and set global user object)." 2691 | }, 2692 | "wc_update_new_customer_past_orders": { 2693 | "prefix": "wc_update_new_customer_past_orders", 2694 | "body": "wc_update_new_customer_past_orders( ${1:customer_id} )", 2695 | "description": "Get past orders (by email) and update them." 2696 | }, 2697 | "wc_paying_customer": { 2698 | "prefix": "wc_paying_customer", 2699 | "body": "wc_paying_customer( ${1:order_id} )", 2700 | "description": "Order Status completed - This is a paying customer." 2701 | }, 2702 | "wc_customer_bought_product": { 2703 | "prefix": "wc_customer_bought_product", 2704 | "body": "wc_customer_bought_product( ${1:customer_email}, ${2:user_id}, ${3:product_id} )", 2705 | "description": "Checks if a user (by email or ID or both) has bought an item." 2706 | }, 2707 | "wc_current_user_has_role": { 2708 | "prefix": "wc_current_user_has_role", 2709 | "body": "wc_current_user_has_role( ${1:role} )", 2710 | "description": "Checks if the current user has a role." 2711 | }, 2712 | "wc_user_has_role": { 2713 | "prefix": "wc_user_has_role", 2714 | "body": "wc_user_has_role( ${1:user}, ${2:role} )", 2715 | "description": "Checks if a user has a role." 2716 | }, 2717 | "wc_customer_has_capability": { 2718 | "prefix": "wc_customer_has_capability", 2719 | "body": "wc_customer_has_capability( ${1:allcaps}, ${2:caps}, ${3:args} )", 2720 | "description": "Checks if a user has a certain capability." 2721 | }, 2722 | "wc_modify_editable_roles": { 2723 | "prefix": "wc_modify_editable_roles", 2724 | "body": "wc_modify_editable_roles( ${1:roles} )", 2725 | "description": "Modify the list of editable roles to prevent non-admin adding admin users." 2726 | }, 2727 | "wc_modify_map_meta_cap": { 2728 | "prefix": "wc_modify_map_meta_cap", 2729 | "body": "wc_modify_map_meta_cap( ${1:caps}, ${2:cap}, ${3:user_id}, ${4:args} )", 2730 | "description": "Modify capabilities to prevent non-admin users editing admin users." 2731 | }, 2732 | "wc_get_customer_download_permissions": { 2733 | "prefix": "wc_get_customer_download_permissions", 2734 | "body": "wc_get_customer_download_permissions( ${1:customer_id} )", 2735 | "description": "Get customer download permissions from the database." 2736 | }, 2737 | "wc_get_customer_available_downloads": { 2738 | "prefix": "wc_get_customer_available_downloads", 2739 | "body": "wc_get_customer_available_downloads( ${1:customer_id} )", 2740 | "description": "Get customer available downloads." 2741 | }, 2742 | "wc_get_customer_total_spent": { 2743 | "prefix": "wc_get_customer_total_spent", 2744 | "body": "wc_get_customer_total_spent( ${1:user_id} )", 2745 | "description": "Get total spent by customer." 2746 | }, 2747 | "wc_get_customer_order_count": { 2748 | "prefix": "wc_get_customer_order_count", 2749 | "body": "wc_get_customer_order_count( ${1:user_id} )", 2750 | "description": "Get total orders by customer." 2751 | }, 2752 | "wc_reset_order_customer_id_on_deleted_user": { 2753 | "prefix": "wc_reset_order_customer_id_on_deleted_user", 2754 | "body": "wc_reset_order_customer_id_on_deleted_user( ${1:user_id} )", 2755 | "description": "Reset customer ID on orders when a user is deleted." 2756 | }, 2757 | "wc_review_is_from_verified_owner": { 2758 | "prefix": "wc_review_is_from_verified_owner", 2759 | "body": "wc_review_is_from_verified_owner( ${1:comment_id} )", 2760 | "description": "Get review verification status." 2761 | }, 2762 | "wc_disable_author_archives_for_customers": { 2763 | "prefix": "wc_disable_author_archives_for_customers", 2764 | "body": "wc_disable_author_archives_for_customers()", 2765 | "description": "Disable author archives for customers." 2766 | }, 2767 | "wc_update_profile_last_update_time": { 2768 | "prefix": "wc_update_profile_last_update_time", 2769 | "body": "wc_update_profile_last_update_time( ${1:user_id}, ${2:old} )", 2770 | "description": "Hooks into the `profile_update` hook to set the user last updated timestamp." 2771 | }, 2772 | "wc_meta_update_last_update_time": { 2773 | "prefix": "wc_meta_update_last_update_time", 2774 | "body": "wc_meta_update_last_update_time( ${1:meta_id}, ${2:user_id}, ${3:meta_key}, ${4:_meta_value} )", 2775 | "description": "Hooks into the update user meta function to set the user last updated timestamp." 2776 | }, 2777 | "wc_set_user_last_update_time": { 2778 | "prefix": "wc_set_user_last_update_time", 2779 | "body": "wc_set_user_last_update_time( ${1:user_id} )", 2780 | "description": "Sets a user's \"last update\" time to the current timestamp." 2781 | }, 2782 | "wc_get_customer_saved_methods_list": { 2783 | "prefix": "wc_get_customer_saved_methods_list", 2784 | "body": "wc_get_customer_saved_methods_list( ${1:customer_id} )", 2785 | "description": "Get customer saved payment methods list." 2786 | }, 2787 | "wc_get_customer_last_order": { 2788 | "prefix": "wc_get_customer_last_order", 2789 | "body": "wc_get_customer_last_order( ${1:customer_id} )", 2790 | "description": "Get info about customer's last order." 2791 | }, 2792 | "wc_user_search_columns": { 2793 | "prefix": "wc_user_search_columns", 2794 | "body": "wc_user_search_columns( ${1:search_columns} )", 2795 | "description": "Add support for searching by display_name." 2796 | }, 2797 | "wc_delete_user_data": { 2798 | "prefix": "wc_delete_user_data", 2799 | "body": "wc_delete_user_data( ${1:user_id} )", 2800 | "description": "When a user is deleted in WordPress, delete corresponding WooCommerce data." 2801 | }, 2802 | "wc_maybe_store_user_agent": { 2803 | "prefix": "wc_maybe_store_user_agent", 2804 | "body": "wc_maybe_store_user_agent( ${1:user_login}, ${2:user} )", 2805 | "description": "Store user agents. Used for tracker." 2806 | }, 2807 | "wc_user_logged_in": { 2808 | "prefix": "wc_user_logged_in", 2809 | "body": "wc_user_logged_in( ${1:user_login}, ${2:user} )", 2810 | "description": "Update logic triggered on login." 2811 | }, 2812 | "wc_current_user_is_active": { 2813 | "prefix": "wc_current_user_is_active", 2814 | "body": "wc_current_user_is_active()", 2815 | "description": "Update when the user was last active." 2816 | }, 2817 | "wc_update_user_last_active": { 2818 | "prefix": "wc_update_user_last_active", 2819 | "body": "wc_update_user_last_active( ${1:user_id} )", 2820 | "description": "Set the user last active timestamp to now." 2821 | }, 2822 | "wc_webhook_process_delivery": { 2823 | "prefix": "wc_webhook_process_delivery", 2824 | "body": "wc_webhook_process_delivery( ${1:webhook}, ${2:arg} )", 2825 | "description": "Process webhook delivery." 2826 | }, 2827 | "wc_deliver_webhook_async": { 2828 | "prefix": "wc_deliver_webhook_async", 2829 | "body": "wc_deliver_webhook_async( ${1:webhook_id}, ${2:arg} )", 2830 | "description": "Wrapper function to execute the `woocommerce_deliver_webhook_async` cron." 2831 | }, 2832 | "wc_is_webhook_valid_topic": { 2833 | "prefix": "wc_is_webhook_valid_topic", 2834 | "body": "wc_is_webhook_valid_topic( ${1:topic} )", 2835 | "description": "Check if the given topic is a valid webhook topic, a topic is valid if:" 2836 | }, 2837 | "wc_get_webhook_statuses": { 2838 | "prefix": "wc_get_webhook_statuses", 2839 | "body": "wc_get_webhook_statuses()", 2840 | "description": "Get Webhook statuses." 2841 | }, 2842 | "wc_load_webhooks": { 2843 | "prefix": "wc_load_webhooks", 2844 | "body": "wc_load_webhooks()", 2845 | "description": "Load webhooks." 2846 | }, 2847 | "wc_get_webhook": { 2848 | "prefix": "wc_get_webhook", 2849 | "body": "wc_get_webhook( ${1:id} )", 2850 | "description": "Get webhook." 2851 | }, 2852 | "wc_register_widgets": { 2853 | "prefix": "wc_register_widgets", 2854 | "body": "wc_register_widgets()", 2855 | "description": "Register Widgets." 2856 | }, 2857 | "wc_get_screen_ids": { 2858 | "prefix": "wc_get_screen_ids", 2859 | "body": "wc_get_screen_ids()", 2860 | "description": "Get all WooCommerce screen ids." 2861 | }, 2862 | "wc_create_page": { 2863 | "prefix": "wc_create_page", 2864 | "body": "wc_create_page( ${1:slug}${2:, ${3:option}${4:, ${5:page_title}${6:, ${7:page_content}${8:, ${9:post_parent}}}}} )", 2865 | "description": "Create a page and store the ID in an option." 2866 | }, 2867 | "woocommerce_admin_fields": { 2868 | "prefix": "woocommerce_admin_fields", 2869 | "body": "woocommerce_admin_fields( ${1:options} )", 2870 | "description": "Output admin fields." 2871 | }, 2872 | "woocommerce_update_options": { 2873 | "prefix": "woocommerce_update_options", 2874 | "body": "woocommerce_update_options( ${1:options}${2:, ${3:data}} )", 2875 | "description": "Update all settings which are passed." 2876 | }, 2877 | "woocommerce_settings_get_option": { 2878 | "prefix": "woocommerce_settings_get_option", 2879 | "body": "woocommerce_settings_get_option( ${1:option_name}${2:, ${3:default}} )", 2880 | "description": "Get a setting from the settings API." 2881 | }, 2882 | "wc_save_order_items": { 2883 | "prefix": "wc_save_order_items", 2884 | "body": "wc_save_order_items( ${1:order_id}, ${2:items} )", 2885 | "description": "Save order items. Uses the CRUD." 2886 | }, 2887 | "wc_render_action_buttons": { 2888 | "prefix": "wc_render_action_buttons", 2889 | "body": "wc_render_action_buttons( ${1:actions} )", 2890 | "description": "Get HTML for some action buttons. Used in list tables." 2891 | }, 2892 | "woocommerce_wp_text_input": { 2893 | "prefix": "woocommerce_wp_text_input", 2894 | "body": "woocommerce_wp_text_input( ${1:field} )", 2895 | "description": "Output a text input box." 2896 | }, 2897 | "woocommerce_wp_hidden_input": { 2898 | "prefix": "woocommerce_wp_hidden_input", 2899 | "body": "woocommerce_wp_hidden_input( ${1:field} )", 2900 | "description": "Output a hidden input box." 2901 | }, 2902 | "woocommerce_wp_textarea_input": { 2903 | "prefix": "woocommerce_wp_textarea_input", 2904 | "body": "woocommerce_wp_textarea_input( ${1:field} )", 2905 | "description": "Output a textarea input box." 2906 | }, 2907 | "woocommerce_wp_checkbox": { 2908 | "prefix": "woocommerce_wp_checkbox", 2909 | "body": "woocommerce_wp_checkbox( ${1:field} )", 2910 | "description": "Output a checkbox input box." 2911 | }, 2912 | "woocommerce_wp_select": { 2913 | "prefix": "woocommerce_wp_select", 2914 | "body": "woocommerce_wp_select( ${1:field} )", 2915 | "description": "Output a select input box." 2916 | }, 2917 | "woocommerce_wp_radio": { 2918 | "prefix": "woocommerce_wp_radio", 2919 | "body": "woocommerce_wp_radio( ${1:field} )", 2920 | "description": "Output a radio input box." 2921 | }, 2922 | "wc_importer_current_locale": { 2923 | "prefix": "wc_importer_current_locale", 2924 | "body": "wc_importer_current_locale()", 2925 | "description": "Importer current locale." 2926 | }, 2927 | "wc_importer_default_english_mappings": { 2928 | "prefix": "wc_importer_default_english_mappings", 2929 | "body": "wc_importer_default_english_mappings( ${1:mappings} )", 2930 | "description": "Add English mapping placeholders when not using English as current language." 2931 | }, 2932 | "wc_importer_default_special_english_mappings": { 2933 | "prefix": "wc_importer_default_special_english_mappings", 2934 | "body": "wc_importer_default_special_english_mappings( ${1:mappings} )", 2935 | "description": "Add English special mapping placeholders when not using English as current language." 2936 | }, 2937 | "wc_importer_generic_mappings": { 2938 | "prefix": "wc_importer_generic_mappings", 2939 | "body": "wc_importer_generic_mappings( ${1:mappings} )", 2940 | "description": "Add generic mappings." 2941 | }, 2942 | "wc_importer_wordpress_mappings": { 2943 | "prefix": "wc_importer_wordpress_mappings", 2944 | "body": "wc_importer_wordpress_mappings( ${1:mappings} )", 2945 | "description": "Add mappings for WordPress tables." 2946 | } 2947 | } --------------------------------------------------------------------------------