/
llms.class.meta.box.text.php
55 lines (45 loc) · 1.3 KB
/
llms.class.meta.box.text.php
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
<?php
/**
* Meta box Field: Text
*
* @package LifterLMS/Admin/PostTypes/MetaBoxes/Fields/Classes
*
* @since Unknown
* @version 3.36.0
*/
defined( 'ABSPATH' ) || exit;
/**
* LLMS_Metabox_Text_Field class
*
* @since Unknown
* @since 3.36.0 When outputting the field's value convert quotes (double and single) HTML entities back to characters.
*/
class LLMS_Metabox_Text_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
public function __construct( $_field ) {
$this->field = $_field;
}
/**
* outputs the Html for the given field
*
* @since 3.36.0 Convert quotes (double and single) HTML entities back to characters.
* @return void
*/
public function output() {
global $post;
parent::output(); ?>
<input type="text"
name="<?php echo $this->field['id']; ?>"
id="<?php echo $this->field['id']; ?>"
<?php if ( array_key_exists( 'required', $this->field ) && $this->field['required'] ) : ?>
required="required"
<?php endif; ?>
class="<?php echo esc_attr( $this->field['class'] ); ?>"
value="<?php echo htmlentities( htmlspecialchars_decode( $this->meta, ENT_QUOTES ) ); ?>" size="30"
<?php if ( isset( $this->field['required'] ) && $this->field['required'] ) : ?>
required="required"
<?php endif; ?>
/>
<?php
parent::close_output();
}
}