subscribe-modal
2 years ago
subscribe-overlay
2 years ago
class-settings.php
2 years ago
jetpack-user-content-link-redirection.php
2 years ago
readme.md
7 years ago
subscriptions.css
7 years ago
views.php
2 years ago
class-settings.php
45 lines
| 1 | <?php |
| 2 | /** |
| 3 | * The Subscriptions settings. |
| 4 | * |
| 5 | * This is a class that contains helper functions for the Subscriptions settings module. |
| 6 | * |
| 7 | * @package automattic/jetpack-subscriptions |
| 8 | */ |
| 9 | |
| 10 | namespace Automattic\Jetpack\Modules\Subscriptions; |
| 11 | |
| 12 | use Automattic\Jetpack\Status\Host; |
| 13 | |
| 14 | /** |
| 15 | * Class Settings |
| 16 | */ |
| 17 | class Settings { |
| 18 | |
| 19 | /** |
| 20 | * Validate the reply-to option. |
| 21 | * |
| 22 | * @param string $reply_to The reply-to option to validate. |
| 23 | * @return bool Whether the reply-to option is valid or not. |
| 24 | */ |
| 25 | public static function is_valid_reply_to( $reply_to ) { |
| 26 | $valid_values = array( 'author', 'no-reply', 'comment' ); |
| 27 | if ( in_array( $reply_to, $valid_values, true ) ) { |
| 28 | return true; |
| 29 | } |
| 30 | return false; |
| 31 | } |
| 32 | /** |
| 33 | * Get the default reply-to option. |
| 34 | * |
| 35 | * @return string The default reply-to option. |
| 36 | */ |
| 37 | public static function get_default_reply_to() { |
| 38 | if ( ( new Host() )->is_wpcom_simple() ) { |
| 39 | return 'comment'; |
| 40 | } |
| 41 | |
| 42 | return 'no-reply'; |
| 43 | } |
| 44 | } |
| 45 |