PluginProbe
Filter Everything — WordPress & WooCommerce Filters / 1.9.7
Filter Everything — WordPress & WooCommerce Filters v1.9.7
1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2.2 1.9.2.1 trunk 1.2.1 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.4.1 1.4.4 1.4.5 1.4.8 1.4.9 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 All 52 releases
← All changes | src/wpc-api.php +11 -4 1.6.11.9.7 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2
3 -if ( ! defined('WPINC') ) {
4 - wp_die();
3 +if ( ! defined('ABSPATH') ) {
4 + exit;
5 5 }
6 6
7 7 // SEO API
8 8 /**
@@ -99,7 +99,14 @@
99 99 * related with current page
100 100 * or empty array if there are no filters
101 101 */
102 102 function flrt_get_page_related_filters(){
103 - $em = \FilterEverything\Filter\Container::instance()->getEntityManager();
104 - return $em->getSetsRelatedFilters();
103 + /**
104 + * @todo add check to hook if
105 + */
106 + if( ! did_action( 'pre_get_posts' ) ) {
107 + _doing_it_wrong( __FUNCTION__, esc_html__('This function should not be called before the pre_get_posts hook has fired.', 'filter-everything'), '1.7.16' );
108 + } else{
109 + $em = \FilterEverything\Filter\Container::instance()->getEntityManager();
110 + return $em->getSetsRelatedFilters();
111 + }
105 112 }