Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | n/a |
0 / 0 |
|
| wpcom_is_nav_redesign_enabled | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| is_proxied | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Features related to the WordPress.com nav redesign. |
| 4 | * |
| 5 | * @package wpcomsh |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Whether to enable the nav redesign. |
| 10 | * |
| 11 | * @return bool True if the nav redesign is enabled, false otherwise. |
| 12 | */ |
| 13 | function wpcom_is_nav_redesign_enabled() { |
| 14 | $uses_wp_admin_interface = get_option( 'wpcom_admin_interface' ) === 'wp-admin'; |
| 15 | |
| 16 | return $uses_wp_admin_interface; |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Returns whether the current request is coming from the a8c proxy. |
| 21 | */ |
| 22 | function is_proxied() { |
| 23 | return isset( $_SERVER['A8C_PROXIED_REQUEST'] ) |
| 24 | ? sanitize_text_field( wp_unslash( $_SERVER['A8C_PROXIED_REQUEST'] ) ) |
| 25 | : defined( 'A8C_PROXIED_REQUEST' ) && A8C_PROXIED_REQUEST; |
| 26 | } |