PluginProbe
BeyondWords – AI audio for publishers / 6.0.3
BeyondWords – AI audio for publishers v6.0.3
7.1.0 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.7.0 All 43 releases
speechkit / src / Component / Settings / Tabs / Credentials / Credentials.php

Credentials.php in BeyondWords – AI audio for publishers 6.0.3, at src/Component/Settings/Tabs/Credentials/Credentials.php

77 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 /**
6 * Settings > BeyondWords > Credentials
7 *
8 * @package Beyondwords\Wordpress
9 * @author Stuart McAlpine <stu@beyondwords.io>
10 * @since 5.0.0
11 */
12
13 namespace Beyondwords\Wordpress\Component\Settings\Tabs\Credentials;
14
15 use Beyondwords\Wordpress\Component\Settings\Fields\ApiKey\ApiKey;
16 use Beyondwords\Wordpress\Component\Settings\Fields\ProjectId\ProjectId;
17
18 /**
19 * "Credentials" settings tab
20 *
21 * @since 5.0.0
22 */
23 class Credentials
24 {
25 /**
26 * Init
27 *
28 * @since 5.0.0
29 * @since 6.0.0 Make static.
30 */
31 public static function init()
32 {
33 (new ApiKey())::init();
34 (new ProjectId())::init();
35
36 add_action('admin_init', [self::class, 'addSettingsSection'], 5);
37 }
38
39 /**
40 * Add Settings sections.
41 *
42 * @since 5.0.0
43 * @since 6.0.0 Make static.
44 */
45 public static function addSettingsSection()
46 {
47 add_settings_section(
48 'credentials',
49 __('Credentials', 'speechkit'),
50 [self::class, 'sectionCallback'],
51 'beyondwords_credentials',
52 );
53 }
54
55 /**
56 * Section callback
57 *
58 * @since 5.0.0
59 * @since 6.0.0 Make static.
60 *
61 * @return void
62 **/
63 public static function sectionCallback()
64 {
65 ?>
66 <p class="description">
67 <?php
68 esc_html_e(
69 'Please add your Project ID and API key to authenticate your BeyondWords account.', // phpcs:ignore Generic.Files.LineLength.TooLong
70 'speechkit'
71 );
72 ?>
73 </p>
74 <?php
75 }
76 }
77