File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ add_filter( 'cron_schedules', function ( $schedules ) {
165165class FQNConstants {
166166 public function add_schedules () {
167167 add_filter ( 'cron_schedules ' , array ( $ this , 'add_weekly_schedule ' ) ); // Ok: > 15 min.
168- add_filter ( 'cron_schedules ' , array ( $ this , 'add_eight_minute_schedule ' ) ); // Warning: 8 min.
168+ \ add_filter ( 'cron_schedules ' , array ( $ this , 'add_eight_minute_schedule ' ) ); // Warning: 8 min.
169169 add_filter ( 'cron_schedules ' , array ( $ this , 'add_hundred_minute_schedule ' ) ); // Warning: time undetermined.
170170 add_filter ( 'cron_schedules ' , array ( $ this , 'sneaky_fake_wp_constant_schedule ' ) ); // Warning: time undetermined.
171171 }
@@ -326,3 +326,11 @@ function first_class_six_min_schedule( $schedules ) {
326326}
327327add_filter ( 'cron_schedules ' , first_class_six_min_schedule (...)); // Warning: 6 min.
328328add_filter ( 'cron_schedules ' , 'first_class_six_min_schedule ' (...)); // Warning: 6 min.
329+
330+ /*
331+ * Safeguard correct handling of all types of namespaced function calls (except FQN global function call which is
332+ * handled above).
333+ */
334+ MyNamespace \add_filter ( 'cron_schedules ' , 'unknown_callback ' ); // Ok.
335+ \MyNamespace \add_filter ( 'cron_schedules ' , 'unknown_callback ' ); // Ok.
336+ namespace \add_filter ( 'cron_schedules ' , 'unknown_callback ' ); // Ok. The sniff should start flagging this once it can resolve relative namespaces.
You can’t perform that action at this time.
0 commit comments