class-ld-settings-section-translations-learndash.php
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* LearnDash Settings Section for Translations LearnDash Metabox.
*
* @since 2.5.2
* @package LearnDash\Settings\Sections
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ( class_exists( 'LearnDash_Settings_Section' ) ) && ( ! class_exists( 'LearnDash_Settings_Section_Translations_LearnDash' ) ) ) {
/**
* Class LearnDash Settings Section for Translations LearnDash Metabox.
*
* @since 2.5.2
*/
class LearnDash_Settings_Section_Translations_LearnDash extends LearnDash_Settings_Section {
/**
* Must match the Text Domain.
*
* @var string $project_slug String for project.
*/
private $project_slug = 'learndash';
/**
* Protected constructor for class
*
* @since 2.5.2
*/
protected function __construct() {
$this->settings_page_id = 'learndash_lms_translations';
$this->setting_option_key = 'learndash';
// Used within the Settings API to uniquely identify this section.
$this->settings_section_key = 'settings_translations_' . $this->project_slug;
// Section label/header.
$this->settings_section_label = esc_html__( 'LearnDash LMS', 'learndash' );
$this->load_options = false;
LearnDash_Translations::register_translation_slug( $this->project_slug, LEARNDASH_LMS_PLUGIN_DIR . 'languages/' );
parent::__construct();
}
/**
* Custom function to metabox.
*
* @since 2.5.2
*/
public function show_meta_box() {
$ld_translations = new LearnDash_Translations( $this->project_slug );
$ld_translations->show_meta_box();
}
}
add_action(
'init',
function() {
LearnDash_Settings_Section_Translations_LearnDash::add_section_instance();
},
1
);
}