Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
1 / 2 |
|
100.00% |
1 / 1 |
CRAP | n/a |
0 / 0 |
|
| jetpack_random_redirect_core_compat | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Keeps the Jetpack random redirect opt-out working with WordPress core's random content redirects. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Turns off core's random content redirects when the Jetpack filter does. |
| 10 | * |
| 11 | * @since 16.5 |
| 12 | * |
| 13 | * @param bool $enabled Whether core's random content redirects are enabled. |
| 14 | * @return bool |
| 15 | */ |
| 16 | function jetpack_random_redirect_core_compat( $enabled ) { |
| 17 | /** This filter is documented in modules/theme-tools/random-redirect.php */ |
| 18 | return $enabled && apply_filters( 'jetpack_random_redirect_enabled', true ); |
| 19 | } |
| 20 | add_filter( 'wp_enable_random_content_redirect', 'jetpack_random_redirect_core_compat' ); |