PluginProbe
Extendify / 3.2.3
Extendify v3.2.3
3.2.3 3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 All 129 releases
extendify / app / Shared / Controllers / SiteVisibilityController.php

SiteVisibilityController.php in Extendify 3.2.3, at app/Shared/Controllers/SiteVisibilityController.php

68 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Controller for site visibility
5 */
6
7 namespace Extendify\Shared\Controllers;
8
9 defined('ABSPATH') || die('No direct access.');
10
11 use Extendify\SiteVisibility;
12
13 /**
14 * The controller for moving the site in and out of Coming Soon mode and for
15 * WordPress's "Discourage search engines" setting
16 */
17
18 class SiteVisibilityController
19 {
20 /**
21 * Publish the site
22 *
23 * @return \WP_REST_Response
24 */
25 public static function publish()
26 {
27 SiteVisibility::markPublished();
28
29 return new \WP_REST_Response(['success' => true]);
30 }
31
32 /**
33 * Unpublish the site
34 *
35 * @return \WP_REST_Response
36 */
37 public static function unpublish()
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();
64
65 return new \WP_REST_Response(['success' => true]);
66 }
67 }
68