← All changes
|
app/Shared/Controllers/SiteVisibilityController.php
+26
-1
3.2.2
→
3.2.3
View file →
| @@ -10,9 +10,10 @@ | ||
| 10 | 10 | |
| 11 | 11 | use Extendify\SiteVisibility; |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * The controller for moving the site in and out of Coming Soon mode | |
| 14 | + * The controller for moving the site in and out of Coming Soon mode and for | |
| 15 | + * WordPress's "Discourage search engines" setting | |
| 15 | 16 | */ |
| 16 | 17 | |
| 17 | 18 | class SiteVisibilityController |
| 18 | 19 | { |
| @@ -35,8 +36,32 @@ | ||
| 35 | 36 | */ |
| 36 | 37 | public static function unpublish() |
| 37 | 38 | { |
| 38 | 39 | SiteVisibility::markUnpublished(); |
| 40 | + | |
| 41 | + return new \WP_REST_Response(['success' => true]); | |
| 42 | + } | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * Let search engines index the site | |
| 46 | + * | |
| 47 | + * @return \WP_REST_Response | |
| 48 | + */ | |
| 49 | + public static function allowIndexing() | |
| 50 | + { | |
| 51 | + SiteVisibility::allowIndexing(); | |
| 52 | + | |
| 53 | + return new \WP_REST_Response(['success' => true]); | |
| 54 | + } | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * Ask search engines not to index the site | |
| 58 | + * | |
| 59 | + * @return \WP_REST_Response | |
| 60 | + */ | |
| 61 | + public static function blockIndexing() | |
| 62 | + { | |
| 63 | + SiteVisibility::blockIndexing(); | |
| 39 | 64 | |
| 40 | 65 | return new \WP_REST_Response(['success' => true]); |
| 41 | 66 | } |
| 42 | 67 | } |