class-ld-settings-section-emails-placeholders.php
2.81 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/**
* LearnDash Settings Section Emails Placeholders Metabox.
*
* @since 2.6.0
* @package LearnDash\Settings\Sections
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ( class_exists( 'LearnDash_Settings_Section' ) ) && ( ! class_exists( 'LearnDash_Settings_Section_Emails_Placeholders' ) ) ) {
/**
* Class LearnDash Settings Section Emails Placeholders Metabox.
*
* @since 2.6.0
*/
class LearnDash_Settings_Section_Emails_Placeholders extends LearnDash_Settings_Section {
/**
* Public constructor for class
*
* @since 2.6.0
*
* @param array $args Array of class args.
*/
public function __construct( $args = array() ) {
$this->settings_page_id = 'learndash_lms_emails';
// This is the 'option_name' key used in the wp_options table.
$this->setting_option_key = 'learndash_settings_emails_placeholders';
// This is the HTML form field prefix used.
$this->setting_field_prefix = 'learndash_settings_emails_placeholders';
// Section label/header.
$this->settings_section_label = esc_html__( 'Email Placeholders', 'learndash' );
$this->metabox_context = 'side';
$this->metabox_priority = 'default';
parent::__construct();
}
/**
* Show custom metabox output for Quick Links.
*
* @since 2.6.0
*/
public function show_meta_box() {
global $wp_meta_boxes;
?>
<div id="ld-emails-placeholders" class="submitbox">
<p>
<?php
// translators: Describes email placeholders available for use.
echo esc_html__( 'Placeholders available for use in the different email notifications', 'learndash' );
?>
</p>
<p><strong>New User Registration</strong></p>
<ul>
<li>{username}</li>
<li>{first_name}</li>
<li>{last_name}</li>
<li>{email}</li>
</ul>
<p><strong>
<?php
// translators: placeholder: Course/Group Purchase Success.
echo sprintf( esc_html_x( ' %1$s/%2$s Purchase Success', 'placeholder: Course/Group Purchase Success.', 'learndash' ), esc_html( learndash_get_custom_label( 'course' ) ), esc_html( learndash_get_custom_label( 'group' ) ) );
?>
</strong></p>
<ul>
<li>{username}</li>
<li>{first_name}</li>
<li>{last_name}</li>
<li>{transaction_id}</li>
</ul>
<p><strong>
<?php
// translators: placeholder: Course/Group Purchase Failed.
echo sprintf( esc_html_x( ' %1$s/%2$s Purchase Failed', 'placeholder: Course/Group Purchase Failed.', 'learndash' ), esc_html( learndash_get_custom_label( 'course' ) ), esc_html( learndash_get_custom_label( 'group' ) ) );
?>
</strong></p>
<ul>
<li>{username}</li>
<li>{first_name}</li>
<li>{last_name}</li>
<li>{transaction_id}</li>
</ul>
</div>
<?php
}
/**
* This is a requires function.
*/
public function load_settings_fields() {
// Nothing to do here.
}
}
}