PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.9.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.9.1
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / admin / views / meta-boxes / fields / class-lp-meta-box-fields.php

class-lp-meta-box-fields.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.3.9.1, at inc/admin/views/meta-boxes/fields/class-lp-meta-box-fields.php

90 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * LP_Meta_Box_Field
5 *
6 * @author nhamdv
7 * @version 1.0.0
8 * @since 4.0.0
9 */
10 class LP_Meta_Box_Field {
11 /**
12 * Key id of field
13 *
14 * @var string
15 */
16 public $id = '';
17
18 /**
19 * Label of field
20 *
21 * @var string
22 */
23 public $label = '';
24
25 /**
26 * Description of field
27 *
28 * @var string
29 */
30 public $description = '';
31
32 /**
33 * Value default of field
34 *
35 * @var mixed
36 */
37 public $default;
38
39 /**
40 * Extra array.
41 *
42 * @var string $class
43 */
44 public $extra = array();
45
46 /**
47 * Condition logic show or hide when checkbox, select or...
48 */
49 public $condition = false;
50
51 /**
52 * LP_Meta_Box_Attribute constructor.
53 *
54 * @param string $id
55 * @param string $label
56 * @param string $description
57 * @param mixed $default
58 * @param mixed $desc_tip
59 * @param mixed $class
60 * @param mixed $style
61 * @param array $custom_attributes
62 */
63 public function __construct( $label = '', $description = '', $default = '', $extra = array() ) {
64 $this->label = $label;
65 $this->description = $description;
66 $this->default = $default;
67 $this->extra = $extra;
68
69 $show = ! empty( $extra['show'] ) ? htmlentities( wp_json_encode( $extra['show'] ) ) : false;
70 $hide = ! empty( $extra['hide'] ) ? htmlentities( wp_json_encode( $extra['hide'] ) ) : false;
71
72 if ( $show ) {
73 $this->condition = 'data-show="' . $show . '"';
74 } elseif ( $hide ) {
75 $this->condition = 'data-hide="' . $hide . '"';
76 }
77 }
78
79 public function meta_value( $thepostid ) {
80 return get_post_meta( $thepostid, $this->id, true );
81 }
82
83 public function output( $thepostid ) {
84 return '';
85 }
86
87 public function save( $post_id ) {
88 }
89 }
90