PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.2.1
Kirki – Freeform Page Builder, Website Builder & Customizer v6.2.1
6.2.1 6.2.0 6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / libraries / framework / Http / RedirectResponse.php
kirki / libraries / framework / Http Last commit date
Client 1 week ago Concerns 1 month ago JsonResponse.php 1 month ago RedirectResponse.php 1 week ago Request.php 1 week ago Response.php 1 month ago
RedirectResponse.php
81 lines
1 <?php
2
3 /**
4 * Redirect response for site route controllers.
5 *
6 * @package Framework
7 * @subpackage Http
8 * @since 1.0.0
9 */
10 namespace Kirki\Framework\Http;
11
12 \defined('ABSPATH') || exit;
13 class RedirectResponse
14 {
15 /**
16 * The redirect target URL.
17 *
18 * @var string
19 *
20 * @since 1.0.0
21 */
22 protected $url;
23 /**
24 * The HTTP redirect status code.
25 *
26 * @var int
27 *
28 * @since 1.0.0
29 */
30 protected $status;
31 /**
32 * Create a new RedirectResponse instance.
33 *
34 * @param string $url The redirect target URL.
35 * @param int $status The HTTP status code.
36 *
37 * @return void
38 *
39 * @since 1.0.0
40 */
41 public function __construct(string $url, int $status = 302)
42 {
43 $this->url = $url;
44 $this->status = $status;
45 }
46 /**
47 * Get the redirect URL.
48 *
49 * @return string
50 *
51 * @since 1.0.0
52 */
53 public function get_url()
54 {
55 return $this->url;
56 }
57 /**
58 * Get the HTTP status code.
59 *
60 * @return int
61 *
62 * @since 1.0.0
63 */
64 public function get_status()
65 {
66 return $this->status;
67 }
68 /**
69 * Send the redirect and terminate the request.
70 *
71 * @return void
72 *
73 * @since 1.0.0
74 */
75 public function send()
76 {
77 wp_safe_redirect($this->url, $this->status);
78 exit;
79 }
80 }
81