Skip to content

Commit 44df453

Browse files
committed
Default to late init of query filtering after plugins_loaded
1 parent 043184e commit 44df453

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

classes/Controllers/Frontend/Restrictions/QueryPosts.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ public function init() {
3737
*/
3838
$init_hook = apply_filters( 'content_control/query_filter_init_hook', null );
3939

40-
if ( is_null( $init_hook ) ) {
41-
$this->late_hooks();
42-
return;
43-
}
44-
4540
/**
4641
* Use this filter to change the priority used to add query post filtering.
4742
*
@@ -50,6 +45,11 @@ public function init() {
5045
*/
5146
$init_priority = apply_filters( 'content_control/query_filter_init_priority', 10 );
5247

48+
if ( is_null( $init_hook ) ) {
49+
$init_hook = 'plugins_loaded';
50+
$init_priority = 999999;
51+
}
52+
5353
add_action( (string) $init_hook, [ $this, 'late_hooks' ], (int) $init_priority );
5454
}
5555

0 commit comments

Comments
 (0)