| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
/** |
| 6 |
* Settings > BeyondWords > Content |
| 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\Content; |
| 14 |
|
| 15 |
use Beyondwords\Wordpress\Component\Settings\Fields\AutoPublish\AutoPublish; |
| 16 |
use Beyondwords\Wordpress\Component\Settings\Fields\IncludeExcerpt\IncludeExcerpt; |
| 17 |
use Beyondwords\Wordpress\Component\Settings\Fields\IncludeTitle\IncludeTitle; |
| 18 |
use Beyondwords\Wordpress\Component\Settings\Fields\IntegrationMethod\IntegrationMethod; |
| 19 |
use Beyondwords\Wordpress\Component\Settings\Fields\PreselectGenerateAudio\PreselectGenerateAudio; |
| 20 |
|
| 21 |
/** |
| 22 |
* "Content" settings tab |
| 23 |
* @since 5.0.0 |
| 24 |
*/ |
| 25 |
class Content |
| 26 |
{ |
| 27 |
/** |
| 28 |
* Init |
| 29 |
* |
| 30 |
* @since 5.0.0 Introduced. |
| 31 |
* @since 6.0.0 Make static and add IntegrationMethod. |
| 32 |
*/ |
| 33 |
public static function init() |
| 34 |
{ |
| 35 |
(new IntegrationMethod())::init(); |
| 36 |
(new IncludeTitle())::init(); |
| 37 |
(new AutoPublish())::init(); |
| 38 |
(new IncludeExcerpt())::init(); |
| 39 |
(new PreselectGenerateAudio())::init(); |
| 40 |
|
| 41 |
add_action('admin_init', [self::class, 'addSettingsSection'], 5); |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Add Settings sections. |
| 46 |
* |
| 47 |
* @since 5.0.0 |
| 48 |
* @since 6.0.0 Make static. |
| 49 |
*/ |
| 50 |
public static function addSettingsSection() |
| 51 |
{ |
| 52 |
add_settings_section( |
| 53 |
'content', |
| 54 |
__('Content', 'speechkit'), |
| 55 |
[self::class, 'sectionCallback'], |
| 56 |
'beyondwords_content', |
| 57 |
); |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
* Section callback |
| 62 |
* |
| 63 |
* @since 5.0.0 |
| 64 |
* @since 6.0.0 Make static. |
| 65 |
* |
| 66 |
* @return void |
| 67 |
**/ |
| 68 |
public static function sectionCallback() |
| 69 |
{ |
| 70 |
?> |
| 71 |
<p class="description"> |
| 72 |
<?php |
| 73 |
esc_html_e( |
| 74 |
'Only future content will be affected. To apply changes to existing content, please regenerate each post.', // phpcs:ignore Generic.Files.LineLength.TooLong |
| 75 |
'speechkit' |
| 76 |
); |
| 77 |
?> |
| 78 |
</p> |
| 79 |
<?php |
| 80 |
} |
| 81 |
} |
| 82 |
|