-
Notifications
You must be signed in to change notification settings - Fork 11
/
functions.json
2947 lines (2947 loc) · 130 KB
/
functions.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"wc": {
"prefix": "wc",
"body": "wc()",
"description": "Main instance of WooCommerce."
},
"wc_lostpassword_url": {
"prefix": "wc_lostpassword_url",
"body": "wc_lostpassword_url( ${1:default_url} )",
"description": "Returns the url to the lost password endpoint url."
},
"wc_customer_edit_account_url": {
"prefix": "wc_customer_edit_account_url",
"body": "wc_customer_edit_account_url()",
"description": "Get the link to the edit account details page."
},
"wc_edit_address_i18n": {
"prefix": "wc_edit_address_i18n",
"body": "wc_edit_address_i18n( ${1:id}${2:, ${3:flip}} )",
"description": "Get the edit address slug translation."
},
"wc_get_account_menu_items": {
"prefix": "wc_get_account_menu_items",
"body": "wc_get_account_menu_items()",
"description": "Get My Account menu items."
},
"wc_get_account_menu_item_classes": {
"prefix": "wc_get_account_menu_item_classes",
"body": "wc_get_account_menu_item_classes( ${1:endpoint} )",
"description": "Get account menu item classes."
},
"wc_get_account_endpoint_url": {
"prefix": "wc_get_account_endpoint_url",
"body": "wc_get_account_endpoint_url( ${1:endpoint} )",
"description": "Get account endpoint URL."
},
"wc_get_account_orders_columns": {
"prefix": "wc_get_account_orders_columns",
"body": "wc_get_account_orders_columns()",
"description": "Get My Account > Orders columns."
},
"wc_get_account_downloads_columns": {
"prefix": "wc_get_account_downloads_columns",
"body": "wc_get_account_downloads_columns()",
"description": "Get My Account > Downloads columns."
},
"wc_get_account_payment_methods_columns": {
"prefix": "wc_get_account_payment_methods_columns",
"body": "wc_get_account_payment_methods_columns()",
"description": "Get My Account > Payment methods columns."
},
"wc_get_account_payment_methods_types": {
"prefix": "wc_get_account_payment_methods_types",
"body": "wc_get_account_payment_methods_types()",
"description": "Get My Account > Payment methods types"
},
"wc_get_account_orders_actions": {
"prefix": "wc_get_account_orders_actions",
"body": "wc_get_account_orders_actions( ${1:order} )",
"description": "Get account orders actions."
},
"wc_get_account_formatted_address": {
"prefix": "wc_get_account_formatted_address",
"body": "wc_get_account_formatted_address( ${1:${2:address_type}${3:, ${4:customer_id}}} )",
"description": "Get account formatted address."
},
"wc_get_account_saved_payment_methods_list": {
"prefix": "wc_get_account_saved_payment_methods_list",
"body": "wc_get_account_saved_payment_methods_list( ${1:list}, ${2:customer_id} )",
"description": "Returns an array of a user's saved payments list for output on the account tab."
},
"wc_get_account_saved_payment_methods_list_item_cc": {
"prefix": "wc_get_account_saved_payment_methods_list_item_cc",
"body": "wc_get_account_saved_payment_methods_list_item_cc( ${1:item}, ${2:payment_token} )",
"description": "Controls the output for credit cards on the my account page."
},
"wc_get_account_saved_payment_methods_list_item_echeck": {
"prefix": "wc_get_account_saved_payment_methods_list_item_echeck",
"body": "wc_get_account_saved_payment_methods_list_item_echeck( ${1:item}, ${2:payment_token} )",
"description": "Controls the output for eChecks on the my account page."
},
"wc_get_text_attributes": {
"prefix": "wc_get_text_attributes",
"body": "wc_get_text_attributes( ${1:raw_attributes} )",
"description": "Gets text attributes from a string."
},
"wc_get_text_attributes_filter_callback": {
"prefix": "wc_get_text_attributes_filter_callback",
"body": "wc_get_text_attributes_filter_callback( ${1:value} )",
"description": "See if an attribute is actually valid."
},
"wc_implode_text_attributes": {
"prefix": "wc_implode_text_attributes",
"body": "wc_implode_text_attributes( ${1:attributes} )",
"description": "Implode an array of attributes using WC_DELIMITER."
},
"wc_get_attribute_taxonomies": {
"prefix": "wc_get_attribute_taxonomies",
"body": "wc_get_attribute_taxonomies()",
"description": "Get attribute taxonomies."
},
"wc_attribute_taxonomy_name": {
"prefix": "wc_attribute_taxonomy_name",
"body": "wc_attribute_taxonomy_name( ${1:attribute_name} )",
"description": "Get a product attribute name."
},
"wc_variation_attribute_name": {
"prefix": "wc_variation_attribute_name",
"body": "wc_variation_attribute_name( ${1:attribute_name} )",
"description": "Get the attribute name used when storing values in post meta."
},
"wc_attribute_taxonomy_name_by_id": {
"prefix": "wc_attribute_taxonomy_name_by_id",
"body": "wc_attribute_taxonomy_name_by_id( ${1:attribute_id} )",
"description": "Get a product attribute name by ID."
},
"wc_attribute_taxonomy_id_by_name": {
"prefix": "wc_attribute_taxonomy_id_by_name",
"body": "wc_attribute_taxonomy_id_by_name( ${1:name} )",
"description": "Get a product attribute ID by name."
},
"wc_attribute_label": {
"prefix": "wc_attribute_label",
"body": "wc_attribute_label( ${1:name}${2:, ${3:product}} )",
"description": "Get a product attributes label."
},
"wc_attribute_orderby": {
"prefix": "wc_attribute_orderby",
"body": "wc_attribute_orderby( ${1:name} )",
"description": "Get a product attributes orderby setting."
},
"wc_get_attribute_taxonomy_names": {
"prefix": "wc_get_attribute_taxonomy_names",
"body": "wc_get_attribute_taxonomy_names()",
"description": "Get an array of product attribute taxonomies."
},
"wc_get_attribute_types": {
"prefix": "wc_get_attribute_types",
"body": "wc_get_attribute_types()",
"description": "Get attribute types."
},
"wc_has_custom_attribute_types": {
"prefix": "wc_has_custom_attribute_types",
"body": "wc_has_custom_attribute_types()",
"description": "Check if there are custom attribute types."
},
"wc_get_attribute_type_label": {
"prefix": "wc_get_attribute_type_label",
"body": "wc_get_attribute_type_label( ${1:type} )",
"description": "Get attribute type label."
},
"wc_check_if_attribute_name_is_reserved": {
"prefix": "wc_check_if_attribute_name_is_reserved",
"body": "wc_check_if_attribute_name_is_reserved( ${1:attribute_name} )",
"description": "Check if attribute name is reserved."
},
"wc_attributes_array_filter_visible": {
"prefix": "wc_attributes_array_filter_visible",
"body": "wc_attributes_array_filter_visible( ${1:attribute} )",
"description": "Callback for array filter to get visible only."
},
"wc_attributes_array_filter_variation": {
"prefix": "wc_attributes_array_filter_variation",
"body": "wc_attributes_array_filter_variation( ${1:attribute} )",
"description": "Callback for array filter to get variation attributes only."
},
"wc_is_attribute_in_product_name": {
"prefix": "wc_is_attribute_in_product_name",
"body": "wc_is_attribute_in_product_name( ${1:attribute}, ${2:name} )",
"description": "Check if an attribute is included in the attributes area of a variation name."
},
"wc_array_filter_default_attributes": {
"prefix": "wc_array_filter_default_attributes",
"body": "wc_array_filter_default_attributes( ${1:attribute} )",
"description": "Callback for array filter to get default attributes. Will allow for '0' string values, but regard all other"
},
"wc_get_attribute": {
"prefix": "wc_get_attribute",
"body": "wc_get_attribute( ${1:id} )",
"description": "Get attribute data by ID."
},
"wc_create_attribute": {
"prefix": "wc_create_attribute",
"body": "wc_create_attribute( ${1:args} )",
"description": "Create attribute."
},
"wc_update_attribute": {
"prefix": "wc_update_attribute",
"body": "wc_update_attribute( ${1:id}, ${2:args} )",
"description": "Update an attribute."
},
"wc_delete_attribute": {
"prefix": "wc_delete_attribute",
"body": "wc_delete_attribute( ${1:id} )",
"description": "Delete attribute by ID."
},
"wc_protected_product_add_to_cart": {
"prefix": "wc_protected_product_add_to_cart",
"body": "wc_protected_product_add_to_cart( ${1:passed}, ${2:product_id} )",
"description": "Prevent password protected products being added to the cart."
},
"wc_empty_cart": {
"prefix": "wc_empty_cart",
"body": "wc_empty_cart()",
"description": "Clears the cart session when called."
},
"wc_load_persistent_cart": {
"prefix": "wc_load_persistent_cart",
"body": "wc_load_persistent_cart( ${1:user_login}, ${2:user} )",
"description": "Load the persistent cart."
},
"wc_get_raw_referer": {
"prefix": "wc_get_raw_referer",
"body": "wc_get_raw_referer()",
"description": "Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer."
},
"wc_add_to_cart_message": {
"prefix": "wc_add_to_cart_message",
"body": "wc_add_to_cart_message( ${1:products}${2:, ${3:show_qty}${4:, ${5:return}}} )",
"description": "Add to cart messages."
},
"wc_format_list_of_items": {
"prefix": "wc_format_list_of_items",
"body": "wc_format_list_of_items( ${1:items} )",
"description": "Comma separate a list of item names, and replace final comma with 'and'."
},
"wc_clear_cart_after_payment": {
"prefix": "wc_clear_cart_after_payment",
"body": "wc_clear_cart_after_payment()",
"description": "Clear cart after payment."
},
"wc_cart_totals_subtotal_html": {
"prefix": "wc_cart_totals_subtotal_html",
"body": "wc_cart_totals_subtotal_html()",
"description": "Get the subtotal."
},
"wc_cart_totals_shipping_html": {
"prefix": "wc_cart_totals_shipping_html",
"body": "wc_cart_totals_shipping_html()",
"description": "Get shipping methods."
},
"wc_cart_totals_taxes_total_html": {
"prefix": "wc_cart_totals_taxes_total_html",
"body": "wc_cart_totals_taxes_total_html()",
"description": "Get taxes total."
},
"wc_cart_totals_coupon_label": {
"prefix": "wc_cart_totals_coupon_label",
"body": "wc_cart_totals_coupon_label( ${1:coupon}${2:, ${3:echo}} )",
"description": "Get a coupon label."
},
"wc_cart_totals_coupon_html": {
"prefix": "wc_cart_totals_coupon_html",
"body": "wc_cart_totals_coupon_html( ${1:coupon} )",
"description": "Get coupon display HTML."
},
"wc_cart_totals_order_total_html": {
"prefix": "wc_cart_totals_order_total_html",
"body": "wc_cart_totals_order_total_html()",
"description": "Get order total html including inc tax if needed."
},
"wc_cart_totals_fee_html": {
"prefix": "wc_cart_totals_fee_html",
"body": "wc_cart_totals_fee_html( ${1:fee} )",
"description": "Get the fee value."
},
"wc_cart_totals_shipping_method_label": {
"prefix": "wc_cart_totals_shipping_method_label",
"body": "wc_cart_totals_shipping_method_label( ${1:method} )",
"description": "Get a shipping methods full label including price."
},
"wc_cart_round_discount": {
"prefix": "wc_cart_round_discount",
"body": "wc_cart_round_discount( ${1:value}, ${2:precision} )",
"description": "Round discount."
},
"wc_get_chosen_shipping_method_ids": {
"prefix": "wc_get_chosen_shipping_method_ids",
"body": "wc_get_chosen_shipping_method_ids()",
"description": "Gets chosen shipping method IDs from chosen_shipping_methods session, without instance IDs."
},
"wc_get_chosen_shipping_method_for_package": {
"prefix": "wc_get_chosen_shipping_method_for_package",
"body": "wc_get_chosen_shipping_method_for_package( ${1:key}, ${2:package} )",
"description": "Get chosen method for package from session."
},
"wc_get_default_shipping_method_for_package": {
"prefix": "wc_get_default_shipping_method_for_package",
"body": "wc_get_default_shipping_method_for_package( ${1:key}, ${2:package}, ${3:chosen_method} )",
"description": "Choose the default method for a package."
},
"wc_shipping_methods_have_changed": {
"prefix": "wc_shipping_methods_have_changed",
"body": "wc_shipping_methods_have_changed( ${1:key}, ${2:package} )",
"description": "See if the methods have changed since the last request."
},
"wc_get_cart_item_data_hash": {
"prefix": "wc_get_cart_item_data_hash",
"body": "wc_get_cart_item_data_hash( ${1:product} )",
"description": "Gets a hash of important product data that when changed should cause cart items to be invalidated."
},
"is_woocommerce": {
"prefix": "is_woocommerce",
"body": "is_woocommerce()",
"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)."
},
"is_shop": {
"prefix": "is_shop",
"body": "is_shop()",
"description": "Is_shop - Returns true when viewing the product type archive (shop)."
},
"is_product_taxonomy": {
"prefix": "is_product_taxonomy",
"body": "is_product_taxonomy()",
"description": "Is_product_taxonomy - Returns true when viewing a product taxonomy archive."
},
"is_product_category": {
"prefix": "is_product_category",
"body": "is_product_category( ${1:term} )",
"description": "Is_product_category - Returns true when viewing a product category."
},
"is_product_tag": {
"prefix": "is_product_tag",
"body": "is_product_tag( ${1:term} )",
"description": "Is_product_tag - Returns true when viewing a product tag."
},
"is_product": {
"prefix": "is_product",
"body": "is_product()",
"description": "Is_product - Returns true when viewing a single product."
},
"is_cart": {
"prefix": "is_cart",
"body": "is_cart()",
"description": "Is_cart - Returns true when viewing the cart page."
},
"is_checkout": {
"prefix": "is_checkout",
"body": "is_checkout()",
"description": "Is_checkout - Returns true when viewing the checkout page."
},
"is_checkout_pay_page": {
"prefix": "is_checkout_pay_page",
"body": "is_checkout_pay_page()",
"description": "Is_checkout_pay - Returns true when viewing the checkout's pay page."
},
"is_wc_endpoint_url": {
"prefix": "is_wc_endpoint_url",
"body": "is_wc_endpoint_url( ${1:endpoint} )",
"description": "Is_wc_endpoint_url - Check if an endpoint is showing."
},
"is_account_page": {
"prefix": "is_account_page",
"body": "is_account_page()",
"description": "Is_account_page - Returns true when viewing an account page."
},
"is_view_order_page": {
"prefix": "is_view_order_page",
"body": "is_view_order_page()",
"description": "Is_view_order_page - Returns true when on the view order page."
},
"is_edit_account_page": {
"prefix": "is_edit_account_page",
"body": "is_edit_account_page()",
"description": "Check for edit account page."
},
"is_order_received_page": {
"prefix": "is_order_received_page",
"body": "is_order_received_page()",
"description": "Is_order_received_page - Returns true when viewing the order received page."
},
"is_add_payment_method_page": {
"prefix": "is_add_payment_method_page",
"body": "is_add_payment_method_page()",
"description": "Is_add_payment_method_page - Returns true when viewing the add payment method page."
},
"is_lost_password_page": {
"prefix": "is_lost_password_page",
"body": "is_lost_password_page()",
"description": "Is_lost_password_page - Returns true when viewing the lost password page."
},
"is_ajax": {
"prefix": "is_ajax",
"body": "is_ajax()",
"description": "Is_ajax - Returns true when the page is loaded via ajax."
},
"is_store_notice_showing": {
"prefix": "is_store_notice_showing",
"body": "is_store_notice_showing()",
"description": "Is_store_notice_showing - Returns true when store notice is active."
},
"is_filtered": {
"prefix": "is_filtered",
"body": "is_filtered()",
"description": "Is_filtered - Returns true when filtering products using layered nav or price sliders."
},
"taxonomy_is_product_attribute": {
"prefix": "taxonomy_is_product_attribute",
"body": "taxonomy_is_product_attribute( ${1:name} )",
"description": "Returns true when the passed taxonomy name is a product attribute."
},
"meta_is_product_attribute": {
"prefix": "meta_is_product_attribute",
"body": "meta_is_product_attribute( ${1:name}, ${2:value}, ${3:product_id} )",
"description": "Returns true when the passed meta name is a product attribute."
},
"wc_tax_enabled": {
"prefix": "wc_tax_enabled",
"body": "wc_tax_enabled()",
"description": "Are store-wide taxes enabled?"
},
"wc_shipping_enabled": {
"prefix": "wc_shipping_enabled",
"body": "wc_shipping_enabled()",
"description": "Is shipping enabled?"
},
"wc_prices_include_tax": {
"prefix": "wc_prices_include_tax",
"body": "wc_prices_include_tax()",
"description": "Are prices inclusive of tax?"
},
"wc_is_valid_url": {
"prefix": "wc_is_valid_url",
"body": "wc_is_valid_url( ${1:url} )",
"description": "Simple check for validating a URL, it must start with http:\/\/ or https:\/\/."
},
"wc_site_is_https": {
"prefix": "wc_site_is_https",
"body": "wc_site_is_https()",
"description": "Check if the home URL is https. If it is, we don't need to do things such as 'force ssl'."
},
"wc_checkout_is_https": {
"prefix": "wc_checkout_is_https",
"body": "wc_checkout_is_https()",
"description": "Check if the checkout is configured for https. Look at options, WP HTTPS plugin, or the permalink itself."
},
"wc_post_content_has_shortcode": {
"prefix": "wc_post_content_has_shortcode",
"body": "wc_post_content_has_shortcode( ${1:tag} )",
"description": "Checks whether the content passed contains a specific short code."
},
"wc_maybe_define_constant": {
"prefix": "wc_maybe_define_constant",
"body": "wc_maybe_define_constant( ${1:name}, ${2:value} )",
"description": "Define a constant if it is not already defined."
},
"wc_create_order": {
"prefix": "wc_create_order",
"body": "wc_create_order( ${1:args} )",
"description": "Create a new order programmatically."
},
"wc_update_order": {
"prefix": "wc_update_order",
"body": "wc_update_order( ${1:args} )",
"description": "Update an order. Uses wc_create_order."
},
"wc_get_template_part": {
"prefix": "wc_get_template_part",
"body": "wc_get_template_part( ${1:slug}${2:, ${3:name}} )",
"description": "Get template part (for templates like the shop-loop)."
},
"wc_get_template": {
"prefix": "wc_get_template",
"body": "wc_get_template( ${1:template_name}${2:, ${3:args}${4:, ${5:template_path}${6:, ${7:default_path}}}} )",
"description": "Get other templates (e.g. product attributes) passing attributes and including the file."
},
"wc_get_template_html": {
"prefix": "wc_get_template_html",
"body": "wc_get_template_html( ${1:template_name}${2:, ${3:args}${4:, ${5:template_path}${6:, ${7:default_path}}}} )",
"description": "Like wc_get_template, but returns the HTML instead of outputting."
},
"wc_locate_template": {
"prefix": "wc_locate_template",
"body": "wc_locate_template( ${1:template_name}${2:, ${3:template_path}${4:, ${5:default_path}}} )",
"description": "Locate a template and return the path for inclusion."
},
"get_woocommerce_currency": {
"prefix": "get_woocommerce_currency",
"body": "get_woocommerce_currency()",
"description": "Get Base Currency Code."
},
"get_woocommerce_currencies": {
"prefix": "get_woocommerce_currencies",
"body": "get_woocommerce_currencies()",
"description": "Get full list of currency codes."
},
"get_woocommerce_currency_symbol": {
"prefix": "get_woocommerce_currency_symbol",
"body": "get_woocommerce_currency_symbol( ${1:currency} )",
"description": "Get Currency symbol."
},
"wc_mail": {
"prefix": "wc_mail",
"body": "wc_mail( ${1:to}, ${2:subject}, ${3:message}${4:, ${5:headers}${6:, ${7:attachments}}} )",
"description": "Send HTML emails from WooCommerce."
},
"wc_get_theme_support": {
"prefix": "wc_get_theme_support",
"body": "wc_get_theme_support( ${1:${2:prop}${3:, ${4:default}}} )",
"description": "Return \"theme support\" values from the current theme, if set."
},
"wc_get_image_size": {
"prefix": "wc_get_image_size",
"body": "wc_get_image_size( ${1:image_size} )",
"description": "Get an image size by name or defined dimensions."
},
"wc_enqueue_js": {
"prefix": "wc_enqueue_js",
"body": "wc_enqueue_js( ${1:code} )",
"description": "Queue some JavaScript code to be output in the footer."
},
"wc_print_js": {
"prefix": "wc_print_js",
"body": "wc_print_js()",
"description": "Output any queued javascript code in the footer."
},
"wc_setcookie": {
"prefix": "wc_setcookie",
"body": "wc_setcookie( ${1:name}, ${2:value}${3:, ${4:expire}${5:, ${6:secure}}} )",
"description": "Set a cookie - wrapper for setcookie using WP constants."
},
"get_woocommerce_api_url": {
"prefix": "get_woocommerce_api_url",
"body": "get_woocommerce_api_url( ${1:path} )",
"description": "Get the URL to the WooCommerce REST API."
},
"wc_get_log_file_path": {
"prefix": "wc_get_log_file_path",
"body": "wc_get_log_file_path( ${1:handle} )",
"description": "Get a log file path."
},
"wc_get_log_file_name": {
"prefix": "wc_get_log_file_name",
"body": "wc_get_log_file_name( ${1:handle} )",
"description": "Get a log file name."
},
"wc_get_page_children": {
"prefix": "wc_get_page_children",
"body": "wc_get_page_children( ${1:page_id} )",
"description": "Recursively get page children."
},
"flush_rewrite_rules_on_shop_page_save": {
"prefix": "flush_rewrite_rules_on_shop_page_save",
"body": "flush_rewrite_rules_on_shop_page_save()",
"description": "Flushes rewrite rules when the shop page (or it's children) gets saved."
},
"wc_fix_rewrite_rules": {
"prefix": "wc_fix_rewrite_rules",
"body": "wc_fix_rewrite_rules( ${1:rules} )",
"description": "Various rewrite rule fixes."
},
"wc_fix_product_attachment_link": {
"prefix": "wc_fix_product_attachment_link",
"body": "wc_fix_product_attachment_link( ${1:link}, ${2:post_id} )",
"description": "Prevent product attachment links from breaking when using complex rewrite structures."
},
"wc_ms_protect_download_rewite_rules": {
"prefix": "wc_ms_protect_download_rewite_rules",
"body": "wc_ms_protect_download_rewite_rules( ${1:rewrite} )",
"description": "Protect downloads from ms-files.php in multisite."
},
"wc_format_country_state_string": {
"prefix": "wc_format_country_state_string",
"body": "wc_format_country_state_string( ${1:country_string} )",
"description": "Formats a string in the format COUNTRY:STATE into an array."
},
"wc_get_base_location": {
"prefix": "wc_get_base_location",
"body": "wc_get_base_location()",
"description": "Get the store's base location."
},
"wc_get_customer_default_location": {
"prefix": "wc_get_customer_default_location",
"body": "wc_get_customer_default_location()",
"description": "Get the customer's default location."
},
"wc_get_user_agent": {
"prefix": "wc_get_user_agent",
"body": "wc_get_user_agent()",
"description": "Get user agent string."
},
"hash_equals": {
"prefix": "hash_equals",
"body": "hash_equals( ${1:a}, ${2:b} )",
"description": "Compare two strings in constant time."
},
"wc_rand_hash": {
"prefix": "wc_rand_hash",
"body": "wc_rand_hash()",
"description": "Generate a rand hash."
},
"wc_api_hash": {
"prefix": "wc_api_hash",
"body": "wc_api_hash( ${1:data} )",
"description": "WC API - Hash."
},
"wc_array_cartesian": {
"prefix": "wc_array_cartesian",
"body": "wc_array_cartesian( ${1:input} )",
"description": "Find all possible combinations of values from the input array and return in a logical order."
},
"wc_transaction_query": {
"prefix": "wc_transaction_query",
"body": "wc_transaction_query( ${1:${2:type}${3:, ${4:force}}} )",
"description": "Run a MySQL transaction query, if supported."
},
"wc_get_cart_url": {
"prefix": "wc_get_cart_url",
"body": "wc_get_cart_url()",
"description": "Gets the url to the cart page."
},
"wc_get_checkout_url": {
"prefix": "wc_get_checkout_url",
"body": "wc_get_checkout_url()",
"description": "Gets the url to the checkout page."
},
"woocommerce_register_shipping_method": {
"prefix": "woocommerce_register_shipping_method",
"body": "woocommerce_register_shipping_method( ${1:shipping_method} )",
"description": "Register a shipping method."
},
"wc_get_shipping_zone": {
"prefix": "wc_get_shipping_zone",
"body": "wc_get_shipping_zone( ${1:package} )",
"description": "Get the shipping zone matching a given package from the cart."
},
"wc_get_credit_card_type_label": {
"prefix": "wc_get_credit_card_type_label",
"body": "wc_get_credit_card_type_label( ${1:type} )",
"description": "Get a nice name for credit card providers."
},
"wc_back_link": {
"prefix": "wc_back_link",
"body": "wc_back_link( ${1:label}, ${2:url} )",
"description": "Outputs a \"back\" link so admin screens can easily jump back a page."
},
"wc_help_tip": {
"prefix": "wc_help_tip",
"body": "wc_help_tip( ${1:tip}${2:, ${3:allow_html}} )",
"description": "Display a WooCommerce help tip."
},
"wc_get_wildcard_postcodes": {
"prefix": "wc_get_wildcard_postcodes",
"body": "wc_get_wildcard_postcodes( ${1:postcode}${2:, ${3:country}} )",
"description": "Return a list of potential postcodes for wildcard searching."
},
"wc_postcode_location_matcher": {
"prefix": "wc_postcode_location_matcher",
"body": "wc_postcode_location_matcher( ${1:postcode}, ${2:objects}, ${3:object_id_key}, ${4:object_compare_key}${5:, ${6:country}} )",
"description": "Used by shipping zones and taxes to compare a given $postcode to stored"
},
"wc_get_shipping_method_count": {
"prefix": "wc_get_shipping_method_count",
"body": "wc_get_shipping_method_count( ${1:include_legacy} )",
"description": "Gets number of shipping methods currently enabled. Used to identify if"
},
"wc_set_time_limit": {
"prefix": "wc_set_time_limit",
"body": "wc_set_time_limit( ${1:limit} )",
"description": "Wrapper for set_time_limit to see if it is enabled."
},
"wc_nocache_headers": {
"prefix": "wc_nocache_headers",
"body": "wc_nocache_headers()",
"description": "Wrapper for nocache_headers which also disables page caching."
},
"wc_product_attribute_uasort_comparison": {
"prefix": "wc_product_attribute_uasort_comparison",
"body": "wc_product_attribute_uasort_comparison( ${1:a}, ${2:b} )",
"description": "Used to sort products attributes with uasort."
},
"wc_shipping_zone_method_order_uasort_comparison": {
"prefix": "wc_shipping_zone_method_order_uasort_comparison",
"body": "wc_shipping_zone_method_order_uasort_comparison( ${1:a}, ${2:b} )",
"description": "Used to sort shipping zone methods with uasort."
},
"wc_get_tax_rounding_mode": {
"prefix": "wc_get_tax_rounding_mode",
"body": "wc_get_tax_rounding_mode()",
"description": "Get rounding mode for internal tax calculations."
},
"wc_get_rounding_precision": {
"prefix": "wc_get_rounding_precision",
"body": "wc_get_rounding_precision()",
"description": "Get rounding precision for internal WC calculations."
},
"wc_add_number_precision": {
"prefix": "wc_add_number_precision",
"body": "wc_add_number_precision( ${1:value}${2:, ${3:round}} )",
"description": "Add precision to a number and return a number."
},
"wc_remove_number_precision": {
"prefix": "wc_remove_number_precision",
"body": "wc_remove_number_precision( ${1:value} )",
"description": "Remove precision from a number and return a float."
},
"wc_add_number_precision_deep": {
"prefix": "wc_add_number_precision_deep",
"body": "wc_add_number_precision_deep( ${1:value}${2:, ${3:round}} )",
"description": "Add precision to an array of number and return an array of int."
},
"wc_remove_number_precision_deep": {
"prefix": "wc_remove_number_precision_deep",
"body": "wc_remove_number_precision_deep( ${1:value} )",
"description": "Remove precision from an array of number and return an array of int."
},
"wc_get_logger": {
"prefix": "wc_get_logger",
"body": "wc_get_logger()",
"description": "Get a shared logger instance."
},
"wc_cleanup_logs": {
"prefix": "wc_cleanup_logs",
"body": "wc_cleanup_logs()",
"description": "Trigger logging cleanup using the logging class."
},
"wc_print_r": {
"prefix": "wc_print_r",
"body": "wc_print_r( ${1:expression}${2:, ${3:return}} )",
"description": "Prints human-readable information about a variable."
},
"wc_register_default_log_handler": {
"prefix": "wc_register_default_log_handler",
"body": "wc_register_default_log_handler( ${1:handlers} )",
"description": "Registers the default log handler."
},
"wc_list_pluck": {
"prefix": "wc_list_pluck",
"body": "wc_list_pluck( ${1:list}, ${2:callback_or_field}${3:, ${4:index_key}} )",
"description": "Based on wp_list_pluck, this calls a method instead of returning a property."
},
"wc_get_permalink_structure": {
"prefix": "wc_get_permalink_structure",
"body": "wc_get_permalink_structure()",
"description": "Get permalink settings for things like products and taxonomies."
},
"wc_switch_to_site_locale": {
"prefix": "wc_switch_to_site_locale",
"body": "wc_switch_to_site_locale()",
"description": "Switch WooCommerce to site language."
},
"wc_restore_locale": {
"prefix": "wc_restore_locale",
"body": "wc_restore_locale()",
"description": "Switch WooCommerce language to original."
},
"wc_make_phone_clickable": {
"prefix": "wc_make_phone_clickable",
"body": "wc_make_phone_clickable( ${1:phone} )",
"description": "Convert plaintext phone number to clickable phone number."
},
"wc_get_post_data_by_key": {
"prefix": "wc_get_post_data_by_key",
"body": "wc_get_post_data_by_key( ${1:key}${2:, ${3:default}} )",
"description": "Get an item of post data if set, otherwise return a default value."
},
"wc_get_var": {
"prefix": "wc_get_var",
"body": "wc_get_var( ${1:&var}${2:, ${3:default}} )",
"description": "Get data if set, otherwise return a default value or null. Prevents notices when data is not set."
},
"wc_enable_wc_plugin_headers": {
"prefix": "wc_enable_wc_plugin_headers",
"body": "wc_enable_wc_plugin_headers( ${1:headers} )",
"description": "Read in WooCommerce headers when reading plugin headers."
},
"wc_prevent_dangerous_auto_updates": {
"prefix": "wc_prevent_dangerous_auto_updates",
"body": "wc_prevent_dangerous_auto_updates( ${1:should_update}, ${2:plugin} )",
"description": "Prevent auto-updating the WooCommerce plugin on major releases if there are untested extensions active."
},
"wc_delete_expired_transients": {
"prefix": "wc_delete_expired_transients",
"body": "wc_delete_expired_transients()",
"description": "Delete expired transients."
},
"wc_get_relative_url": {
"prefix": "wc_get_relative_url",
"body": "wc_get_relative_url( ${1:url} )",
"description": "Make a URL relative, if possible."
},
"wc_is_external_resource": {
"prefix": "wc_is_external_resource",
"body": "wc_is_external_resource( ${1:url} )",
"description": "See if a resource is remote."
},
"wc_is_active_theme": {
"prefix": "wc_is_active_theme",
"body": "wc_is_active_theme( ${1:theme} )",
"description": "See if theme\/s is activate or not."
},
"wc_cleanup_session_data": {
"prefix": "wc_cleanup_session_data",
"body": "wc_cleanup_session_data()",
"description": "Cleans up session data - cron callback."
},
"wc_decimal_to_fraction": {
"prefix": "wc_decimal_to_fraction",
"body": "wc_decimal_to_fraction( ${1:decimal} )",
"description": "Convert a decimal (e.g. 3.5) to a fraction (e.g. 7\/2)."
},
"wc_round_discount": {
"prefix": "wc_round_discount",
"body": "wc_round_discount( ${1:value}, ${2:precision} )",
"description": "Round discount."
},
"wc_selected": {
"prefix": "wc_selected",
"body": "wc_selected( ${1:value}, ${2:options} )",
"description": "Return the html selected attribute if stringified $value is found in array of stringified $options"
},
"wc_get_server_database_version": {
"prefix": "wc_get_server_database_version",
"body": "wc_get_server_database_version()",
"description": "Retrieves the MySQL server version. Based on $wpdb."
},
"wc_get_coupon_types": {
"prefix": "wc_get_coupon_types",
"body": "wc_get_coupon_types()",
"description": "Get coupon types."
},
"wc_get_coupon_type": {
"prefix": "wc_get_coupon_type",
"body": "wc_get_coupon_type( ${1:type} )",
"description": "Get a coupon type's name."
},
"wc_get_product_coupon_types": {
"prefix": "wc_get_product_coupon_types",
"body": "wc_get_product_coupon_types()",
"description": "Coupon types that apply to individual products. Controls which validation rules will apply."
},
"wc_get_cart_coupon_types": {
"prefix": "wc_get_cart_coupon_types",
"body": "wc_get_cart_coupon_types()",
"description": "Coupon types that apply to the cart as a whole. Controls which validation rules will apply."
},
"wc_coupons_enabled": {
"prefix": "wc_coupons_enabled",
"body": "wc_coupons_enabled()",
"description": "Check if coupons are enabled."
},
"wc_get_coupon_code_by_id": {
"prefix": "wc_get_coupon_code_by_id",
"body": "wc_get_coupon_code_by_id( ${1:id} )",
"description": "Get coupon code by ID."
},
"wc_get_coupon_id_by_code": {
"prefix": "wc_get_coupon_id_by_code",
"body": "wc_get_coupon_id_by_code( ${1:code}${2:, ${3:exclude}} )",
"description": "Get coupon code by ID."
},
"wc_string_to_bool": {
"prefix": "wc_string_to_bool",
"body": "wc_string_to_bool( ${1:string} )",
"description": "Converts a string (e.g. 'yes' or 'no') to a bool."
},
"wc_bool_to_string": {
"prefix": "wc_bool_to_string",
"body": "wc_bool_to_string( ${1:bool} )",
"description": "Converts a bool to a 'yes' or 'no'."
},
"wc_string_to_array": {
"prefix": "wc_string_to_array",
"body": "wc_string_to_array( ${1:string}${2:, ${3:delimiter}} )",
"description": "Explode a string into an array by $delimiter and remove empty values."
},
"wc_sanitize_taxonomy_name": {
"prefix": "wc_sanitize_taxonomy_name",
"body": "wc_sanitize_taxonomy_name( ${1:taxonomy} )",
"description": "Sanitize taxonomy names. Slug format (no spaces, lowercase)."
},
"wc_sanitize_permalink": {
"prefix": "wc_sanitize_permalink",
"body": "wc_sanitize_permalink( ${1:value} )",
"description": "Sanitize permalink values before insertion into DB."
},
"wc_get_filename_from_url": {
"prefix": "wc_get_filename_from_url",
"body": "wc_get_filename_from_url( ${1:file_url} )",
"description": "Gets the filename part of a download URL."
},
"wc_get_dimension": {
"prefix": "wc_get_dimension",
"body": "wc_get_dimension( ${1:dimension}, ${2:to_unit}${3:, ${4:from_unit}} )",
"description": "Normalise dimensions, unify to cm then convert to wanted unit value."
},
"wc_get_weight": {
"prefix": "wc_get_weight",
"body": "wc_get_weight( ${1:weight}, ${2:to_unit}${3:, ${4:from_unit}} )",
"description": "Normalise weights, unify to kg then convert to wanted unit value."
},
"wc_trim_zeros": {
"prefix": "wc_trim_zeros",
"body": "wc_trim_zeros( ${1:price} )",
"description": "Trim trailing zeros off prices."
},
"wc_round_tax_total": {
"prefix": "wc_round_tax_total",
"body": "wc_round_tax_total( ${1:value}${2:, ${3:precision}} )",
"description": "Round a tax amount."
},
"wc_legacy_round_half_down": {
"prefix": "wc_legacy_round_half_down",
"body": "wc_legacy_round_half_down( ${1:value}, ${2:precision} )",
"description": "Round half down in PHP 5.2."
},
"wc_format_refund_total": {
"prefix": "wc_format_refund_total",
"body": "wc_format_refund_total( ${1:amount} )",
"description": "Make a refund total negative."
},
"wc_format_decimal": {
"prefix": "wc_format_decimal",
"body": "wc_format_decimal( ${1:number}${2:, ${3:dp}${4:, ${5:trim_zeros}}} )",
"description": "Format decimal numbers ready for DB storage."
},
"wc_float_to_string": {
"prefix": "wc_float_to_string",
"body": "wc_float_to_string( ${1:float} )",
"description": "Convert a float to a string without locale formatting which PHP adds when changing floats to strings."
},
"wc_format_localized_price": {
"prefix": "wc_format_localized_price",
"body": "wc_format_localized_price( ${1:value} )",
"description": "Format a price with WC Currency Locale settings."
},
"wc_format_localized_decimal": {
"prefix": "wc_format_localized_decimal",
"body": "wc_format_localized_decimal( ${1:value} )",
"description": "Format a decimal with PHP Locale settings."
},
"wc_format_coupon_code": {
"prefix": "wc_format_coupon_code",
"body": "wc_format_coupon_code( ${1:value} )",
"description": "Format a coupon code."
},
"wc_clean": {
"prefix": "wc_clean",
"body": "wc_clean( ${1:var} )",
"description": "Clean variables using sanitize_text_field. Arrays are cleaned recursively."
},
"wc_check_invalid_utf8": {
"prefix": "wc_check_invalid_utf8",
"body": "wc_check_invalid_utf8( ${1:var} )",
"description": "wp_check_invalid_utf8 with recursive array support."
},
"wc_sanitize_textarea": {
"prefix": "wc_sanitize_textarea",
"body": "wc_sanitize_textarea( ${1:var} )",
"description": "Run wc_clean over posted textarea but maintain line breaks."
},
"wc_sanitize_tooltip": {
"prefix": "wc_sanitize_tooltip",
"body": "wc_sanitize_tooltip( ${1:var} )",
"description": "Sanitize a string destined to be a tooltip."
},
"wc_array_overlay": {
"prefix": "wc_array_overlay",
"body": "wc_array_overlay( ${1:a1}, ${2:a2} )",
"description": "Merge two arrays."
},
"wc_stock_amount": {
"prefix": "wc_stock_amount",
"body": "wc_stock_amount( ${1:amount} )",
"description": "Formats a stock amount by running it through a filter."
},
"get_woocommerce_price_format": {
"prefix": "get_woocommerce_price_format",
"body": "get_woocommerce_price_format()",
"description": "Get the price format depending on the currency position."
},
"wc_get_price_thousand_separator": {
"prefix": "wc_get_price_thousand_separator",
"body": "wc_get_price_thousand_separator()",
"description": "Return the thousand separator for prices."
},
"wc_get_price_decimal_separator": {
"prefix": "wc_get_price_decimal_separator",
"body": "wc_get_price_decimal_separator()",
"description": "Return the decimal separator for prices."
},
"wc_get_price_decimals": {
"prefix": "wc_get_price_decimals",
"body": "wc_get_price_decimals()",
"description": "Return the number of decimals after the decimal point."
},
"wc_price": {
"prefix": "wc_price",
"body": "wc_price( ${1:price}${2:, ${3:args}} )",
"description": "Format the price with a currency symbol."
},
"wc_let_to_num": {
"prefix": "wc_let_to_num",
"body": "wc_let_to_num( ${1:size} )",
"description": "Notation to numbers."
},
"wc_date_format": {
"prefix": "wc_date_format",
"body": "wc_date_format()",
"description": "WooCommerce Date Format - Allows to change date format for everything WooCommerce."