class-ld-settings-section-side-submit.php
2.19 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
<?php
/**
* LearnDash Settings Side Submit Metabox.
*
* @since 2.6.0
* @package LearnDash\Settings\Sections
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ( class_exists( 'LearnDash_Settings_Section' ) ) && ( ! class_exists( 'LearnDash_Settings_Section_Side_Submit' ) ) ) {
/**
* Class LearnDash Settings Side Submit Metabox.
*
* @since 2.6.0
*/
class LearnDash_Settings_Section_Side_Submit extends LearnDash_Settings_Section {
/**
* Public constructor for class
*
* @since 2.6.0
*
* @param array $args Array of class args.
*/
public function __construct( $args = array() ) {
if ( ( isset( $args['settings_screen_id'] ) ) && ( ! empty( $args['settings_screen_id'] ) ) ) {
$this->settings_screen_id = $args['settings_screen_id'];
}
if ( ( isset( $args['settings_page_id'] ) ) && ( ! empty( $args['settings_page_id'] ) ) ) {
$this->settings_page_id = $args['settings_page_id'];
}
if ( ( ! empty( $this->settings_screen_id ) ) && ( ! empty( $this->settings_page_id ) ) ) {
// This is the 'option_name' key used in the wp_options table.
$this->setting_option_key = 'submitdiv';
// Section label/header.
$this->settings_section_label = esc_html__( 'Save Options', 'learndash' );
$this->metabox_context = 'side';
$this->metabox_priority = 'high';
$this->load_options = false;
parent::__construct();
// We override the parent value set for $this->metabox_key because we want the div ID to match the details WordPress
// value so it will be hidden.
$this->metabox_key = 'submitdiv';
}
}
/**
* Primary function to show the metabox output
*
* @since 2.6.0
*/
public function show_meta_box() {
?>
<div id="submitpost" class="submitbox">
<div id="major-publishing-actions">
<div id="publishing-action">
<span class="spinner"></span>
<?php submit_button( esc_html__( 'Save', 'learndash' ), 'primary', 'submit', false ); ?>
</div>
<div class="clear"></div>
</div><!-- #major-publishing-actions -->
</div><!-- #submitpost -->
<?php
}
/**
* Load settings fields
*
* This is a requires function.
*/
public function load_settings_fields() {
}
}
}