PluginProbe
Extendify / trunk
Extendify vtrunk
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 0.5.0 0.6.0 All 127 releases
← All changes | app/HelpCenter/Controllers/SupportArticlesController.php +3 -9 3.0.5 → trunk View file →
@@ -7,8 +7,9 @@
7 7 namespace Extendify\HelpCenter\Controllers;
8 8
9 9 defined('ABSPATH') || die('No direct access.');
10 10
11 +use Extendify\Constants;
11 12 use Extendify\Shared\Services\Sanitizer;
12 13
13 14 /**
14 15 * The controller for fetching support articles
@@ -16,15 +17,8 @@
16 17
17 18 class SupportArticlesController
18 19 {
19 20 /**
20 - * The url for the server.
21 - *
22 - * @var string
23 - */
24 - public static $host = 'https://kb.extendify.com';
25 -
26 - /**
27 21 * Return support articles from source.
28 22 *
29 23 * @return \WP_REST_Response
30 24 */
@@ -33,9 +27,9 @@
33 27 if (!defined('EXTENDIFY_PARTNER_ID')) {
34 28 return new \WP_REST_Response([], 200);
35 29 }
36 30
37 - $response = wp_remote_get(sprintf('%s/api/posts?lang=%s', static::$host, \get_locale()));
31 + $response = wp_remote_get(sprintf('%s/api/posts?lang=%s', Constants::KB_HOST, \get_locale()));
38 32
39 33 if (is_wp_error($response)) {
40 34 return new \WP_REST_Response([]);
41 35 }
@@ -54,9 +48,9 @@
54 48 {
55 49 $response = wp_remote_get(
56 50 sprintf(
57 51 '%s/api/posts/%s?lang=%s',
58 - static::$host,
52 + Constants::KB_HOST,
59 53 $request->get_param('slug'),
60 54 \get_locale()
61 55 )
62 56 );