-
Notifications
You must be signed in to change notification settings - Fork 0
/
wc-mix-and-match-products-stubs.php
8692 lines (8691 loc) · 225 KB
/
wc-mix-and-match-products-stubs.php
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
<?php
/**
* Admin AJAX meta-box handlers.
*/
class WC_MNM_Admin_Ajax
{
/**
* Hook in.
*/
public static function init()
{
}
/*
|--------------------------------------------------------------------------
| Edit-Order.
|--------------------------------------------------------------------------
*/
/**
* True when displaying content in an edit-container order item modal.
*
* @deprecated 2.3.0
* @return bool
*/
public static function is_container_edit_request()
{
}
/**
* Form content used to populate "Configure/Edit" container order item modals.
*
* @deprecated 2.3.0
*/
public static function ajax_container_order_item_form()
{
}
/**
* Validates edited/configured containers and returns updated order items.
*
* @deprecated 2.3.0
*/
public static function ajax_edit_container_in_order()
{
}
/**
* Validates user can edit this product.
*
* @return mixed - If editable will return an array. Otherwise, will return WP_Error.
*
* @deprecated 2.3.0
*/
protected static function can_edit_container()
{
}
}
class WC_MNM_Admin_Notes
{
/**
* Attach hooks and filters
*/
public static function init()
{
}
/**
* Include the notes to create.
*
* @since 2.4.1
*/
public static function possibly_add_notes()
{
}
/**
* Include the notes to create.
*
* @since 2.4.1 - renamed already.
*/
public static function initialize_notes()
{
}
}
/**
* WC_MNM_Admin_Notices Class.
*
* Handle the addition/display of admin notices.
*/
class WC_MNM_Admin_Notices
{
/**
* Constructor.
*/
public static function init()
{
}
/**
* Store notices to DB.
*/
public static function store_notices()
{
}
/**
* Get notices
*
* @since 2.0.0
*
* @return array
*/
public static function get_notices()
{
}
/**
* Remove all notices.
*/
public static function remove_all_notices()
{
}
/**
* Add a notice/error.
*
* @param string $name Notice name.
* @param bool $force_save Force saving inside this method instead of at the 'shutdown'.
* @param bool $save_notice - deprecated 3rd arg.
*/
public static function add_notice($name, $force_save = \false, $save_notice = \false)
{
}
/**
* Remove a notice from being displayed.
*
* @since 2.0.0
*
* @see WC_Admin_Notices::hide_notice() if there is a need to make a notice dismissable and store user meta. More relevant to optional notices.
*
* @param string $name Notice name.
* @param bool $force_save Force saving inside this method instead of at the 'shutdown'.
*/
public static function remove_notice($name, $force_save = \false)
{
}
/**
* See if a notice is being shown.
*
* @since 2.0.0
*
* @param string $name Notice name.
* @return boolean
*/
public static function has_notice($name)
{
}
/**
* Hide a notice if the GET variable is set.
*
* @since 2.0.0
*/
public static function hide_notices()
{
}
/**
* Show maintenance notices.
*/
public static function add_notices()
{
}
/**
* Add custom notice.
* NB: see WC_Admin_Notices:add_custom_notice if we need to make these persistent/dismissiable.
*
* @since 2.0.0
*
* @param string $name Notice name - currently not used.
* @param string $notice_html Notice HTML.
* @param string $notice_type Class added to notice div.
*/
public static function add_custom_notice($name = '', $notice_html = '', $notice_type = 'error')
{
}
/**
* Add 'update' maintenance notice.
*
* @since 1.10.0
*/
public static function update_notice()
{
}
/*
|--------------------------------------------------------------------------
| Deprecated.
|--------------------------------------------------------------------------
*/
/**
* Show any stored error messages.
*
* @deprecated 2.0.0
*/
public static function output_notices()
{
}
/**
* Add a maintenance notice to be displayed.
*
* @deprecated 2.0.0
*
* @param string $notice_name
*/
public static function add_maintenance_notice($notice_name)
{
}
/**
* Remove a maintenance notice.
*
* @deprecated 2.0.0
*
* @param string $notice_name
*/
public static function remove_maintenance_notice($notice_name)
{
}
/**
* Dismisses a notice.
*
* @since 1.10.0
* @deprecated 2.0.0
*
* @param string $notice
*/
public static function dismiss_notice($notice)
{
}
/**
* Checks if a maintenance notice is visible.
*
* @since 1.10.0
*
* @param string $notice_name
* @return boolean
*/
public static function is_maintenance_notice_visible($notice_name)
{
}
/**
* Checks if a dismissible notice has been dismissed in the past.
*
* @since 1.10.0
* @deprecated 2.0.0
*
* @param string $notice_name
* @return boolean
*/
public static function is_dismissible_notice_dismissed($notice_name)
{
}
/**
* Save errors to an option.
*
* @deprecated 2.0.0
*/
public static function save_notices()
{
}
/**
* Show maintenance notices.
*/
public static function hook_maintenance_notices()
{
}
/**
* Act upon clicking on a 'dismiss notice' link.
*
* @deprecated 2.0.0
*/
public static function dismiss_notice_handler()
{
}
/**
* Add 'updating' maintenance notice.
*
* @deprecated 1.10.0
*/
public static function updating_notice()
{
}
}
/**
* WC_Mix_and_Match_Admin Class.
*
* Loads admin tabs, scripts and adds related hooks / filters.
*/
class WC_Mix_and_Match_Admin
{
/**
* Bootstraps the class and hooks required.
*/
public static function init()
{
}
/**
* Message to add in the WP Privacy Policy Guide page.
*
* @since 1.3.3
*
* @return string
*/
protected static function get_privacy_policy_guide_message()
{
}
/**
* Admin init.
*/
public static function includes()
{
}
/**
* Add a message in the WP Privacy Policy Guide page.
*
* @since 1.3.3
*/
public static function add_privacy_policy_guide_content()
{
}
/**
* Load the product metabox script.
*/
public static function admin_scripts()
{
}
/**
* Add an icon to MNM product data tab
*
* @deprecated 1.7.0 - Rule is in mnm-admin.css.
*/
public static function admin_header()
{
}
/**
* Add template overrides for MNM to WooCommerce Tracker.
*
* @param array $paths
* @return array
*/
public static function template_scan_path($paths)
{
}
/**
* Renders the MNM information in the WC status page
*
* @props to ProsPress
*/
public static function render_system_status_items()
{
}
/**
* Show row meta on the plugin screen.
*
* @param mixed $links
* @param mixed $file
* @return array
*/
public static function plugin_row_meta($links, $file)
{
}
/**
* Include the upgrade notice that will fire when 1.3.0 is released.
*
* @param array $plugin_data information about the plugin
* @param array $response response from the server about the new version
*/
public static function update_notice($plugin_data, $response)
{
}
}
/**
* WC_MNM_Product_Export Class.
*
* Add support for MNM products to WooCommerce product export.
*/
class WC_MNM_Product_Export
{
/**
* Hook in.
*/
public static function init()
{
}
/**
* Add CSV columns for exporting container data.
*
* @param array $columns
* @return array $columns
*/
public static function add_columns($columns)
{
}
/**
* "Contents source" column content.
*
* @since 2.0.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_content_source($value, $product)
{
}
/**
* "Child Category Ids" column content.
*
* @since 2.0.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_child_category_ids($value, $product)
{
}
/**
* MnM child items data column content.
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_child_items($value, $product)
{
}
/**
* "Min Container Quantity" column content.
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_min_container_size($value, $product)
{
}
/**
* "max Container Quantity" column content.
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_max_container_size($value, $product)
{
}
/**
* "Container priced per product" column content.
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_priced_per_product($value, $product)
{
}
/**
* "Container packing mode" column content.
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_packing_mode($value, $product)
{
}
/**
* "Container Weight Cumulative" column content.
*
* @since 2.0.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_weight_cumulative($value, $product)
{
}
/**
* "Container Discount per product" column content.
*
* @since 1.4.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_discount_per_product($value, $product)
{
}
/**
* "Layout override" column content.
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_layout_override($value, $product)
{
}
/**
* "Layout" column content.
*
* @since 1.4.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_layout($value, $product)
{
}
/**
* "Add to cart form location" column content.
*
* @since 1.4.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_add_to_cart_form_location($value, $product)
{
}
/**
* JSON-encode child items for export.
*
* @since 2.3.0
*
* @param WC_Product $product
* @return mixed $value
*/
public static function prepare_child_items_for_export($product)
{
}
/**
* JSON encode categories for export.
*
* @since 2.3.0
*
* @param WC_Product $product
* @return mixed $value
*/
public static function prepare_child_category_ids_for_export($product)
{
}
/**
* MnM contents data column content.
*
* @deprecated 2.0.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_contents($value, $product)
{
}
/**
* "Container shipped per product" column content.
*
* @deprecated 2.0.0
*
* @param mixed $value
* @param WC_Product $product
* @return mixed $value
*/
public static function export_shipped_per_product($value, $product)
{
}
}
/**
* WC_MNM_Product_Import Class.
*
* Add support for MNM products to WooCommerce product import.
*/
class WC_MNM_Product_Import
{
/**
* Hook in.
*/
public static function init()
{
}
/**
* Register the 'Custom' columns in the importer.
*
* @param array $columns
* @return array $columns
*/
public static function map_columns($columns)
{
}
/**
* Add automatic mapping support for custom columns.
*
* @param array $columns
* @return array $columns
*/
public static function add_columns_to_mapping_screen($columns)
{
}
/**
* Set formatting (decoding) callback for child item data.
*
* @since 2.3.0
*
* @param array $callbacks
* @param WC_Product_CSV_Importer $importer
* @return array
*/
public static function append_formatting_callbacks($callbacks, $importer)
{
}
/**
* JSON Decode MNM child data.
*
* @since 2.3.0
*
* @param string $value Field value.
* @return array
*/
public static function decode_child_items($value)
{
}
/**
* If not null string, parse an integer.
*
* @since 2.3.0
*
* @param string $value Field value.
* @return mixed
*/
public static function maybe_parse_intval($value)
{
}
/**
* Decode MNM child data items and parse relative IDs.
*
* @param array $parsed_data
* @param WC_Product_CSV_Importer $importer
* @return array
*/
public static function parse_child_items($parsed_data, $importer)
{
}
/**
* Set container-type props.
* NB: We shouldn't need to parse anything further here. Parsed by core on import and rest handled by setters.
*
* @param WC_Product
* @param array $parsed_data
* @return WC_Product
*/
public static function set_mnm_props($product, $data)
{
}
/**
* Get container-type props from parsed data.
*
* @param array $data
* @param WC_Product
* @return array
*/
public static function get_parsed_props($data, $product)
{
}
/**
* Decode MNM data items and parse relative IDs.
*
* @deprecated 2.0.0
*
* @param array $parsed_data
* @param WC_Product_CSV_Importer $importer
* @return array
*/
public static function parse_mnm_items($parsed_data, $importer)
{
}
/**
* Decode MNM child category items and parse relative term IDs.
*
* @since 2.0.0
* @deprecated 2.3.0 - Register formatter directly in append_formatting_callbacks()
*
* @param array $parsed_data
* @param WC_Product_CSV_Importer $importer
* @return array
*/
public static function parse_child_category_ids($parsed_data, $importer)
{
}
}
/**
* Mix and Match edit-order functions and filters.
*/
class WC_MNM_Meta_Box_Order
{
/**
* Order object to use in 'display_edit_button'.
*
* @var WC_Order
*/
protected static $order;
/**
* Setup Admin class.
*/
public static function init()
{
}
/*
|--------------------------------------------------------------------------
| Filter hooks.
|--------------------------------------------------------------------------
*/
/**
* Auto-populate child order-items for Mix and Match containers that don't require configuration.
*
* @param $item_id int
* @param $item WC_Order_Item
* @param $order WC_Order
*/
public static function add_child_items($item_id, $item, $order)
{
}
/**
* Save order object to use in 'display_edit_button'.
*
* Although the order object can be retrieved via 'WC_Order_Item::get_order', we've seen a significant performance hit when using that method.
*
* @param WC_Order $order
*/
public static function set_order($order)
{
}
/**
* Reattach the edit button when doing ajax.
*
* @since 2.4.0
*/
public static function reattach_edit_button()
{
}
/**
* Display "Configure/Edit" button next to configurable Mix and Match container items in the edit-order screen.
*
* @param $item_id int
* @param $item WC_Order_Item
* @param $order WC_Product
*/
public static function display_edit_button($item_id, $item, $product)
{
}
/*
|--------------------------------------------------------------------------
| Edit-Order Modal.
|--------------------------------------------------------------------------
*/
/**
* Force tabular layout and hide child links.
*
* @since 2.3.0
*
* @param $product WC_Product_Mix_and_Match
* @param $order_item WC_Order_Item
* @param $order WC_Order
* @param string $source The originating source loading this template
*/
public static function force_container_styles($product, $order_item, $order, $source)
{
}
/**
* Nuke any theme overrides of quantity-input.php template.
*
* @since 2.3.0
*
* @param $item_id int
* @param $item WC_Order_Item
* @param $order WC_Product
* @return void
*/
public static function force_core_template($template, $template_name, $args, $template_path, $default_path)
{
}
/**
* JS template of modal for configuring/editing containers.
*/
public static function add_js_template()
{
}
}
/**
* WC_MNM_Meta_Box_Product_Data Class.
*
* Adds and save product meta.
*/
class WC_MNM_Meta_Box_Product_Data
{
/**
* Bootstraps the class and hooks required.
*/
public static function init()
{
}
/**
* Adds the 'mix and match product' type to the product types dropdown.
*
* @param array $options
* @return array
* @deprecated 1.8.0 moved to WC_MNM_Install class
*/
public static function product_selector_filter($options)
{
}
/**
* Mix-and-match type options.
*
* @param array $options
* @return array
*/
public static function type_options($options)
{
}
/**
* Shipping type image select html.
*
* @since 2.0.0
*/
public static function container_shipping_options_admin_html()
{
}
/**
* Adds the MnM Product write panel tabs.
*
* @param array $tabs
* @return array
*/
public static function product_data_tab($tabs)
{
}
/**
* Write panel.
*/
public static function product_data_panel()
{
}
/**
* Add container discount option.
*
* @param int $post_id
* @param WC_Mix_and_Match $mnm_product_object
*/
public static function discount_options($post_id, $mnm_product_object)
{
}
/**
* Render Layout options on 'wc_mnm_admin_product_options'.
*
* @param int $post_id
* @param WC_Mix_and_Match $mnm_product_object
*/
public static function container_layout_options($post_id, $mnm_product_object)
{
}
/**
* Adds the container size option writepanel options.
*
* @param int $post_id
* @param WC_Product_Mix_and_Match $mnm_product_object
* @since 1.0.7
*/
public static function container_size_options($post_id, $mnm_product_object)
{
}
/**
* Adds allowed contents select2 writepanel options.
*
* @param int $post_id
* @param WC_Product_Mix_and_Match $mnm_product_object
* @since 1.0.7
*/
public static function allowed_contents_options($post_id, $mnm_product_object)
{
}
/**
* Adds the MnM per-item pricing option.
*
* @param int $post_id
* @param WC_Product_Mix_and_Match $mnm_product_object
* @since 1.2.0
*/
public static function pricing_options($post_id, $mnm_product_object)
{
}
/**
* Adds the MnM per-item shipping option.
*
* @param int $post_id
* @param WC_Product_Mix_and_Match $mnm_product_object
* @since 1.2.0
* @deprecated 2.0.0 - Moved to Shipping Panel
*/
public static function shipping_options($post_id, $mnm_product_object)
{
}
/**
* Process, verify and save product data
*
* @param WC_Product $product
*/
public static function process_mnm_data($product)
{
}
/**
* Process allowed child items into array.
*
* @param WC_Product $product
* @param array $data [ int The Product|Variation ID ]
* @return array [ int => [
* 'product_id' => int,
* 'variation_id' => int
* ] ]
*/
public static function process_child_items_data($product, $data)
{
}
}
/**
* Support note.
*/
class WC_MNM_Notes_Get_Support
{
/**
* Note traits.
*/
use \Automattic\WooCommerce\Admin\Notes\NoteTraits;
/**
* Name of the note for use in the database.
*/
const NOTE_NAME = 'wc-mnm-admin-get-support-note';
/**
* Get the note.
*
* @return Note
*/
public static function get_note()
{
}
}
/**
* Add_First_Product.
*/
class WC_MNM_Notes_Help_Improve
{
/**
* Note traits.
*/
use \Automattic\WooCommerce\Admin\Notes\NoteTraits;
/**
* Name of the note for use in the database.
*/
const NOTE_NAME = 'wc-mnm-admin-help-improve-note';
/**
* Get the note.
*
* @return Note
*/
public static function get_note()
{
}
}
/**
* WC_MNM_Notes_Run_Db_Update.
*/
class WC_MNM_Notes_Run_Db_Update
{
const NOTE_NAME = 'wc-mnm-update-db-reminder';
/**
* Attach hooks.
*/
public function __construct()
{
}
/**
* Set this notice to an actioned one, so that it's no longer displayed.
*/
public static function set_notice_actioned()
{
}
/**
* Prepare the correct content of the db update note to be displayed by WC Admin.
*
* This one gets called on each page load, so try to bail quickly.
*
* If the db needs an update, the notice should be always shown.
* If the db does not need an update, but the notice has *not* been actioned (i.e. after the db update, when
* store owner hasn't acknowledged the successful db update), still show the Thanks notice.
* If the db does not need an update, and the notice has been actioned, then notice should *not* be shown.
* The notice should also be hidden if the db does not need an update and the notice does not exist.
*/
public static function show_reminder()