-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfacetwp-stubs.php
More file actions
2304 lines (2303 loc) · 45.6 KB
/
Copy pathfacetwp-stubs.php
File metadata and controls
2304 lines (2303 loc) · 45.6 KB
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
/**
* Generated stub declarations for FacetWP
* @see https://facetwp.com/
* @see https://github.com/php-stubs/facetwp-pro-stubs
*/
class FacetWP_API_Fetch
{
function __construct()
{
}
// PHP < 5.3
function register()
{
}
// PHP < 5.3
function callback($request)
{
}
// PHP < 5.3
function permission_callback($request)
{
}
function process_request($params = [])
{
}
}
class FacetWP_Ajax
{
public $url_vars;
public $query_vars;
public $is_preload;
function __construct()
{
}
function switchboard()
{
}
/**
* Save admin settings
*/
function save_settings()
{
}
/**
* Rebuild the index table
*/
function rebuild_index()
{
}
function get_info()
{
}
/**
* Return query arguments based on a Query Builder object
*/
function get_query_args()
{
}
/**
* Keep track of indexing progress
*/
function heartbeat()
{
}
/**
* License activation
*/
function license()
{
}
/**
* Import / export functionality
*/
function backup()
{
}
/**
* The AJAX facet refresh handler
*/
function refresh()
{
}
/**
* Resume stalled indexer
*/
function resume_index()
{
}
}
class FacetWP_Builder
{
public $css = [];
public $data = [];
public $custom_css;
function __construct()
{
}
/**
* Generate CSS class string (helper method)
* @since 3.9.3
*/
function get_classes($type, $settings)
{
}
/**
* Generate the layout HTML
* @since 3.2.0
*/
function render_layout($layout)
{
}
/**
* Generate the row HTML
* @since 3.2.0
*/
function render_row($row)
{
}
/**
* Generate the col HTML
* @since 3.2.0
*/
function render_col($col)
{
}
/**
* Generate the item HTML
* @since 3.2.0
*/
function render_item($item)
{
}
/**
* Parse dynamic tags, e.g. {{ first_name }}
*/
function parse_dynamic_tags($output, $params)
{
}
/**
* Calculate some dynamic tag values on-the-fly, to prevent
* unnecessary queries and extra load time
*/
function dynamic_tag_value($tag_value, $tag_name, $params)
{
}
/**
* Build the redundant styles (border, padding,etc)
* @since 3.2.0
*/
function build_styles($settings)
{
}
/**
* Build the CSS widths, e.g. for "padding" or "border-width"
* @since 3.2.0
*/
function get_widths($data)
{
}
/**
* Convert a value into a link
* @since 3.2.0
*/
function linkify($value, $link_data, $term_data = [])
{
}
/**
* Turn the CSS array into valid CSS
* @since 3.2.0
*/
function render_css()
{
}
/**
* Filter out empty or invalid rules
* @since 3.2.0
*/
function get_valid_css_rules($props)
{
}
/**
* Optimize CSS rules
* @since 3.2.0
*/
function is_valid_css_rule($prop, $value)
{
}
/**
* Make sure the query is valid
* @since 3.2.0
*/
function parse_query_obj($query_obj)
{
}
/**
* Get necessary values for the layout builder
* @since 3.2.0
*/
function get_layout_data()
{
}
/**
* Get necessary data for the query builder
* @since 3.0.0
*/
function get_query_data()
{
}
/**
* Replace "date|" placeholders with actual dates
*/
function hydrate_date_values($query_args)
{
}
/**
* Let users pull URI or GET params into the query builder
* E.g. "http:uri", "http:uri:0", or "http:get:year"
* @since 3.6.0
*/
function parse_uri_tags($values)
{
}
/**
* Initialize CodeMirror for Listing Builder editors
* @since 4.3.2
*/
function initialize_builder_editor($hook)
{
}
}
class FacetWP_Diff
{
/**
* Compare "facetwp_settings" with "facetwp_settings_last_index" to determine
* whether the user needs to rebuild the index
* @since 3.0.9
*/
function is_reindex_needed()
{
}
function is_indexable($facet)
{
}
/**
* Get an array element
* @since 3.0.9
*/
function get_attr($name, $collection)
{
}
}
class FacetWP_Display
{
/* (array) Facet types being used on the page */
public $active_types = [];
/* (array) Facets being used on the page */
public $active_facets = [];
/* (array) Extra features used on the page */
public $active_extras = [];
/* (array) Saved shortcode attributes */
public $shortcode_atts = [];
/* (boolean) Whether to enable FacetWP for the current page */
public $load_assets = \false;
/* (array) Scripts and stylesheets to enqueue */
public $assets = [];
/* (array) Data to pass to front-end JS */
public $json = [];
function __construct()
{
}
/**
* Detect the loop container if the "facetwp-template" class is missing
*/
function add_template_tag($wp_query)
{
}
/**
* Set default values for atts
*
* Old: [facetwp template="foo" static]
* New: [facetwp template="foo" static="true"]
*/
function normalize_atts($atts)
{
}
/**
* Register shortcodes
*/
function shortcode($atts)
{
}
/**
* get google api key from GMAPS_API_KEY, facetwp_gmaps_api_key filter, or gmaps_api_key setting
* @since 4.4
* */
function get_gmaps_api_key()
{
}
/**
* backwards compatibility for params added in facetwp_gmaps_url filter
* @since 4.4
*/
function gmaps_params($params)
{
}
/**
* Output facet scripts
*/
function front_scripts()
{
}
}
final class FacetWP_Helper
{
/* (array) The facetwp_settings option (after hooks) */
public $settings;
/* (array) Associative array of facet objects */
public $facet_types;
/* (array) Cached data sources */
public $data_sources;
/* (array) Cached terms */
public $term_cache;
function __construct()
{
}
/**
* Parse the URL hostname
*/
function get_http_host()
{
}
/**
* Get the current page URI
*/
function get_uri()
{
}
/**
* Get available facet types *
* @since 4.4 Added Map type facet
*/
function get_facet_types()
{
}
/**
* Get settings and allow for developer hooks
*/
function load_settings($last_index = \false)
{
}
/**
* Get a general setting value
*
* @param string $name The setting name
* @param mixed $default The default value
* @since 1.9
*/
function get_setting($name, $default = '')
{
}
/**
* Get an array of all facets
* @return array
*/
function get_facets()
{
}
/**
* Get an array of all templates
* @return array
*/
function get_templates()
{
}
/**
* Get all properties for a single facet
* @param string $facet_name
* @return mixed An array of facet info, or false
*/
function get_facet_by_name($facet_name)
{
}
/**
* Get all properties for a single template
*
* @param string $template_name
* @return mixed An array of template info, or false
*/
function get_template_by_name($template_name)
{
}
/**
* Fetch facets using one of its settings
* @param string $setting_name
* @param mixed $setting_value
* @return array
*/
function get_facets_by($setting, $value)
{
}
/**
* Fetch facets by data source type (prefix, ie tax, cf, acf ...)
* @param string $value
* @return array
* @since 4.4
*/
function get_facets_by_datasource_type($value)
{
}
/**
* Get terms across all languages (thanks, WPML)
* @since 3.8.5
*/
function get_terms($taxonomy)
{
}
/**
* Get an array of term information, including depth
* @param string $taxonomy The taxonomy name
* @return array Term information
* @since 0.9.0
*/
function get_term_depths($taxonomy)
{
}
/**
* Finish sorting the facet values
* The results are already sorted by depth and (name OR count), we just need
* to move the children directly below their parents
*/
function sort_taxonomy_values($values = [], $orderby = 'count')
{
}
/**
* Sanitize SQL data
* @return mixed The sanitized value(s)
* @since 3.0.7
*/
function sanitize($input)
{
}
/**
* Escape output data
* @return mixed the escaped value(s)
* @since 4.2.0
*/
function escape($input)
{
}
/**
* Does an active facet with the specified setting exist?
* @return boolean
* @since 1.4.0
*/
function facet_setting_exists($setting_name, $setting_value)
{
}
/**
* Does this facet have a setting with the specified value?
* @return boolean
* @since 2.3.4
*/
function facet_is($facet, $setting_name, $setting_value)
{
}
/**
* Hash a facet value if needed
* @return string
* @since 2.1
*/
function safe_value($value)
{
}
/**
* Properly format numbers, taking separators into account
* @return number
* @since 2.7.5
*/
function format_number($num)
{
}
/**
* Get facet data sources
* @return array
* @since 2.2.1
*/
function get_data_sources($context = 'default')
{
}
/**
* Sort facetwp_facet_sources by weight
* @since 2.7.5
*/
function sort_by_weight($a, $b)
{
}
/**
* Get row counts for all facets
* @since 3.3.4
*/
function get_row_counts()
{
}
/**
* Get indexable post types
*/
function get_indexable_types()
{
}
/**
* Grab the license key
* @since 3.0.3
*/
function get_license_key()
{
}
/**
* Determine whether the license is active
* @since 3.3.0
*/
function is_license_active()
{
}
/**
* Get a license meta value
* Possible keys: status, message, expiration, payment_id, price_id
* @since 3.5.3
*/
function get_license_meta($key = 'status')
{
}
}
class FacetWP_Indexer
{
/* (boolean) wp_insert_post running? */
public $is_saving = \false;
/* (boolean) Whether to index a single post */
public $index_all = \false;
/* (int) Number of posts to index before updating progress */
public $chunk_size = 10;
/* (string) Whether a temporary table is active */
public $table;
/* (array) Facet properties for the value being indexed */
public $facet;
/* (array) Value modifiers set via the admin UI */
public $modifiers;
/* (bool) Whether indexing hooks are in use */
public $is_overridden;
function __construct()
{
}
/**
* Event listeners
* @since 2.8.4
*/
function run_hooks()
{
}
/**
* Cron task
* @since 2.8.5
*/
function run_cron()
{
}
/**
* Update the index when posts get saved
* @since 0.1.0
*/
function save_post($post_id)
{
}
/**
* Update the index when posts get deleted
* @since 0.6.0
*/
function delete_post($post_id)
{
}
/**
* Update the index when terms get saved
* @since 0.6.0
*/
function edit_term($term_id, $tt_id, $taxonomy)
{
}
/**
* Update the index when terms get deleted
* @since 0.6.0
*/
function delete_term($term_id, $tt_id, $taxonomy)
{
}
/**
* We're hijacking wp_insert_post_parent
* Prevent our set_object_terms() hook from firing within wp_insert_post
* @since 2.2.2
*/
function is_wp_insert_post($post_parent)
{
}
/**
* Support for manual taxonomy associations
* @since 0.8.0
*/
function set_object_terms($object_id)
{
}
/**
* Rebuild the facet index
* @param mixed $post_id The post ID (set to FALSE to re-index everything)
*/
function index($post_id = \false)
{
}
/**
* Get the array of indexer query args
* @since 4.1.8
*/
function get_query_args($post_id = \false)
{
}
/**
* Get an array of post IDs to index
* @since 3.6.8
*/
function get_post_ids_to_index($post_id = \false)
{
}
/**
* Index an individual post
* @since 3.6.8
*/
function index_post($post_id, $facets)
{
}
/**
* Get data for a table row
* @since 2.1.1
*/
function get_row_data($defaults)
{
}
/**
* Index a facet value
* @since 0.6.0
*/
function index_row($params)
{
}
/**
* Save a facet value to DB
* This can be trigged by "facetwp_index_row" to handle multiple values
* @since 1.2.5
*/
function insert($params)
{
}
/**
* Get the indexing completion percentage
* @return mixed The decimal percentage, or -1
* @since 0.1.0
*/
function get_progress()
{
}
/**
* Get indexer transient variables
* @since 1.7.8
*/
function get_transient($name = \false)
{
}
/**
* Set either the index or temp table
* @param string $table 'auto', 'index', or 'temp'
* @since 4.1.4
*/
function set_table($table = 'auto')
{
}
/**
* Index table management
* @since 3.5
*/
function manage_temp_table($action = 'create')
{
}
/**
* Populate an array of facet value modifiers (defined in the admin UI)
* @since 3.5.6
*/
function load_value_modifiers($facets)
{
}
}
class FacetWP_Init
{
function __construct()
{
}
/**
* Initialize classes and WP hooks
*/
function init()
{
}
/**
* i18n support
*/
function load_textdomain()
{
}
/**
* Register the FacetWP settings page
*/
function admin_menu()
{
}
/**
* Notify users to install necessary integrations
*/
function admin_notices()
{
}
/**
* Enqueue jQuery
*/
function front_scripts()
{
}
/**
* Route to the correct edit screen
*/
function settings_page()
{
}
/**
* Prevent WP from redirecting FWP pager to /page/X
*/
function redirect_canonical($redirect_url, $requested_url)
{
}
/**
* Add "Settings" link to plugin listing page
*/
function plugin_action_links($links)
{
}
/**
* WooCommerce 3.6+ doesn't load its frontend includes for REST API requests
* We need to force-load these includes for FacetWP refreshes
* See includes() within class-woocommerce.php
*
* This code isn't within /integrations/woocommerce/ because it runs *before* init
*
* @since 3.3.10
*/
function is_rest_api_request($request)
{
}
}
class FacetWP_Overrides
{
public $raw;
function __construct()
{
}
/**
* Indexer modifications
*/
function index_row($params, $class)
{
}
/**
* Make sure that numbers are properly formatted
*/
function format_numbers($params, $class)
{
}
/**
* Ignore certain post types
*/
function ignore_post_types($is_main_query, $query)
{
}
/**
* Disable indexer
*/
function disable_indexer($enabled)
{
}
}
class FacetWP_Renderer
{
/* (array) Data for the current facets */
public $facets;
/* (array) Data for the current template */
public $template;
/* (array) WP_Query arguments */
public $query_args;
/* (array) WP_Query args when "facetwp_template_use_archive" is enabled */
public $archive_args;
/* (array) Data used to build the pager */
public $pager_args;
/* (string) MySQL WHERE clause passed to each facet */
public $where_clause = '';
/* (array) AJAX parameters passed in */
public $ajax_params;
/* (array) HTTP parameters from the original page (URI, GET) */
public $http_params;
/* (boolean) Is search active? */
public $is_search = \false;
/* (boolean) Are we preloading? */
public $is_preload = \false;
/* (array) Cache preloaded facet values */
public $preloaded_values;
/* (array) The final WP_Query object */
public $query;
/* (array) Convenience var */
public $facet_types;
function __construct()
{
}
/**
* Generate the facet output
* @param array $params An array of arrays (see the FacetWP->refresh() method)
* @return array
*/
function render($params)
{
}
/**
* Get WP_Query arguments by executing the template "query" field
* @return null
*/
function get_query_args()
{
}
/**
* Get ALL post IDs for the matching query
* @return array An array of post IDs
*/
function get_filtered_post_ids($query_args = [])
{
}
/**
* Run the template display code
* @return string (HTML)
*/
function get_template_html()
{
}
/**
* Result count (1-10 of 234)
* @param array $params An array with "page", "per_page", and "total_rows"
* @return string
*/
function get_result_count($params = [])
{
}
/**
* Pagination
* @param array $params An array with "page", "per_page", and "total_rows"
* @return string
*/
function paginate($params = [])
{
}
/**
* "Per Page" dropdown box
* @return string
*/
function get_per_page_box()
{
}
/**
* Get debug info for the browser console
* @since 3.5.7
*/
function get_debug_info()
{
}
/**
* Display the location of relevant hooks (for Debug Mode)
* @since 3.5.7
*/
function get_hooks_used()
{
}
}
class FacetWP_Request
{
/* (array) FacetWP-related GET variables */
public $url_vars = [];
/* (mixed) The main query vars */
public $query_vars = \null;
/* (boolean) FWP template shortcode? */
public $is_shortcode = \false;
/* (boolean) Is a FacetWP refresh? */
public $is_refresh = \false;
/* (boolean) Initial load? */
public $is_preload = \false;
/* (string) Name of active FacetWP template */
public $template_name;
/* (array) Response output */
public $output;
function __construct()
{
}
/**
* application/json requires processing the raw PHP input stream
*/
function process_json()
{
}
/**
* If AJAX and the template is "wp", return the buffered HTML
* Otherwise, store the GET variables for later use
*/
function intercept_request()
{
}
/**
* FacetWP runs the archive query before WP gets the chance.
* This hook prevents the query from running twice, by letting us inject the
* first query's posts (and counts) into the "main" query.
*/
function maybe_abort_query($posts, $query)
{
}
/**
* Fixes https://core.trac.wordpress.org/ticket/40393
*/
function sacrificial_lamb($query)
{
}
/**
* Force FacetWP to use the default WP query
*/
function update_query_vars($query)
{
}
/**
* Is this the main query?
*/
function is_main_query($query)
{
}
/**
* Process the AJAX $_POST data
* This gets passed into FWP()->facet->render()
*/
function process_post_data()
{
}
/**
* On initial pageload, preload the data
*
* This gets called twice; once in the template shortcode (to grab only the template)
* and again in FWP()->display->front_scripts() to grab everything else.
*
* Two calls are needed for timing purposes; the template shortcode often renders
* before some or all of the other FacetWP-related shortcodes.
*/
function process_preload_data($template_name = \false, $overrides = [])
{
}
/**
* This gets called from FWP()->display->front_scripts(), when we finally
* know which shortcodes are on the page.
*
* Since we already got the template HTML on the first process_preload_data() call,
* this time we're grabbing everything but the template.
*
* The return value of this method gets passed into the 2nd argument of
* process_preload_data().
*/
function process_preload_overrides($items)
{
}
/**
* Inject the page HTML into the JSON response
* We'll cherry-pick the content from the HTML using front.js
*/
function inject_template()
{
}
}
class FacetWP_Settings
{
/**
* Get the field settings array
* @since 3.0.0
*/
function get_registered_settings()
{
}