Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| WPCOM_Email_Subscription_Checker | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| has_email | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * A class that checks for the existence of email subscriptions for a user. |
| 4 | * |
| 5 | * @package automattic/jetpack-masterbar |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\Masterbar; |
| 9 | |
| 10 | /** |
| 11 | * WPCOM_Email_Subscription_Checker |
| 12 | */ |
| 13 | class WPCOM_Email_Subscription_Checker { |
| 14 | |
| 15 | /** |
| 16 | * Checks if a user's site has an email subscription |
| 17 | * |
| 18 | * @return bool |
| 19 | */ |
| 20 | public function has_email() { |
| 21 | if ( ! function_exists( 'wpcom_site_has_feature' ) ) { |
| 22 | return false; |
| 23 | } |
| 24 | |
| 25 | return wpcom_site_has_feature( \WPCOM_Features::EMAIL_SUBSCRIPTION ); |
| 26 | } |
| 27 | } |