Skip to content

Commit

Permalink
fix(activation/hooks): ensure priority value is valid
Browse files Browse the repository at this point in the history
* closes #964
* related: `activate/hook_priority` (08f0a07)
  • Loading branch information
Archetyped committed Sep 9, 2022
1 parent f1cd878 commit cf43806
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ public function hooks_add_last( $data = null ) {
}

// Get lowest priority for filter.
$max_priority = max( array_keys( $wp_filter[ $tag ]->callbacks ) ) + 123;
$max_priority = max( array_keys( $wp_filter[ $tag ]->callbacks ) );
// Add priority offset
if ( $max_priority < PHP_INT_MAX ) {
$max_priority += min( 123, PHP_INT_MAX - $max_priority );
}

switch ( $tag ) {
case 'the_content':
Expand Down

0 comments on commit cf43806

Please sign in to comment.