PluginProbe
QuadMenu – Mega Menu / 1.8.8
QuadMenu – Mega Menu v1.8.8
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / lib / ReduxCore / inc / fields / raw / field_raw.php

field_raw.php in QuadMenu – Mega Menu 1.8.8, at lib/ReduxCore/inc/fields/raw/field_raw.php

53 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 if ( ! class_exists( 'ReduxFramework_raw' ) ) {
9 class ReduxFramework_raw {
10
11 /**
12 * Field Constructor.
13 * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
14 *
15 * @since ReduxFramework 3.0.4
16 */
17 function __construct( $field = array(), $value = '', $parent ) {
18 $this->parent = $parent;
19 $this->field = $field;
20 $this->value = $value;
21 }
22
23 /**
24 * Field Render Function.
25 * Takes the vars and outputs the HTML for the field in the settings
26 *
27 * @since ReduxFramework 1.0.0
28 */
29 function render() {
30
31 if ( ! empty( $this->field['include'] ) && file_exists( $this->field['include'] ) ) {
32 require_once $this->field['include'];
33 }
34
35 if ( isset( $this->field['content_path'] ) && ! empty( $this->field['content_path'] ) && file_exists( $this->field['content_path'] ) ) {
36 $this->field['content'] = $this->parent->filesystem->execute( 'get_contents', $this->field['content_path'] );
37 }
38
39 if ( ! empty( $this->field['content'] ) && isset( $this->field['content'] ) ) {
40 if ( isset( $this->field['markdown'] ) && $this->field['markdown'] == true && ! empty( $this->field['content'] ) ) {
41 require_once dirname( __FILE__ ) . "/parsedown.php";
42 $Parsedown = new Parsedown();
43 echo $Parsedown->text( $this->field['content'] );
44 } else {
45 echo $this->field['content'];
46 }
47 }
48
49 do_action( 'redux-field-raw-' . $this->parent->args['opt_name'] . '-' . $this->field['id'] );
50
51 }
52 }
53 }