PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.2
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.2
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Module/Admin.php +21 -1 3.4.13.4.2 View file →
@@ -70,10 +70,30 @@
70 70
71 71 $this->_addAction( 'visualizer_chart_schedules_spl', 'addSplChartSchedules', null, 10, 3 );
72 72
73 73 $this->_addAction( 'admin_init', 'init' );
74 +
75 + if ( defined( 'TI_CYPRESS_TESTING' ) ) {
76 + $this->load_cypress_hooks();
77 + }
78 +
74 79 }
75 80
81 + /**
82 + * Define the hooks that are needed for cypress.
83 + *
84 + * @since 3.4.0
85 + * @access private
86 + */
87 + private function load_cypress_hooks() {
88 + // all charts should load on the same page without pagination.
89 + add_filter(
90 + 'visualizer_query_args', function( $args ) {
91 + $args['posts_per_page'] = 20;
92 + return $args;
93 + }, 10, 1
94 + );
95 + }
76 96
77 97 /**
78 98 * Add disabled `optgroup` schedules to the drop downs.
79 99 *
@@ -740,9 +760,9 @@
740 760 $meta = isset( $query_args['meta_query'] ) ? $query_args['meta_query'] : array();
741 761 $meta[] = $query;
742 762 $query_args['meta_query'] = $meta;
743 763 }
744 - $q = new WP_Query( $query_args );
764 + $q = new WP_Query( apply_filters( 'visualizer_query_args', $query_args ) );
745 765 return $q;
746 766 }
747 767
748 768 /**