PluginProbe
BeyondWords – AI audio for publishers / 4.0.6
BeyondWords – AI audio for publishers v4.0.6
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 / Compatibility / Elementor / ControlsSections / Help.php

Help.php in BeyondWords – AI audio for publishers 4.0.6, at src/Compatibility/Elementor/ControlsSections/Help.php

76 lines 2.1 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 namespace Beyondwords\Wordpress\Compatibility\Elementor\ControlsSections;
6
7 use Elementor\Controls_Manager;
8 use Elementor\Core\DocumentTypes\PageBase as PageBase;
9
10 use WP_Post;
11
12 /**
13 * Help Controls Section
14 *
15 * @codeCoverageIgnore
16 *
17 * @since 3.10.0
18 */
19 class Help
20 {
21 /**
22 * Register additional document controls.
23 *
24 * @todo replace with `$post = get_post();` with `$document->get_post();`?
25 *
26 * @param PageBase $document The PageBase document.
27 * @param string $tab The Elementor tab.
28 */
29 public static function registerControls(&$document, $tab)
30 {
31 // PageBase is the base class for documents like `post` `page` and etc.
32 if (! $document instanceof PageBase || ! $document::get_property('has_elements')) {
33 return;
34 }
35
36 $post = get_post();
37
38 if (!($post instanceof \WP_Post)) {
39 return;
40 }
41
42 $document->start_controls_section(
43 'beyondwords_help_section',
44 [
45 'label' => __('Help', 'speechkit'),
46 'tab' => $tab,
47 ]
48 );
49
50 $document->add_control(
51 'beyondwords_help_guide',
52 [
53 'text' => __('Setup guide', 'speechkit'),
54 'type' => Controls_Manager::BUTTON,
55 'label_block' => true,
56 'label' => __('For setup instructions, troubleshooting, and FAQs, see our BeyondWords for WordPress guide.', 'speechkit'), // phpcs:ignore
57 'event' => 'beyondwords:open-guide'
58 ]
59 );
60
61 $document->add_control(
62 'beyondwords_help_email',
63 [
64 'text' => __('Email BeyondWords', 'speechkit'),
65 'type' => Controls_Manager::BUTTON,
66 'separator' => 'before',
67 'label_block' => true,
68 'label' => __('Need help? Email our support team.', 'speechkit'),
69 'event' => 'beyondwords:email-support'
70 ]
71 );
72
73 $document->end_controls_section();
74 }
75 }
76