. * * @package ReduxFramework * @subpackage Field_Border * @author Daniel J Griffiths (Ghost1227) * @author Dovy Paukstys (dovy) * @version 3.0.0 */ // Exit if accessed directly if( !defined( 'ABSPATH' ) ) exit; // Don't duplicate me! if( !class_exists( 'ReduxFramework_border' ) ) { /** * Main ReduxFramework_border class * * @since 1.0.0 */ class ReduxFramework_border extends ReduxFramework{ /** * Field Constructor. * * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function * * @since 1.0.0 * @access public * @param array $field * @param array $value * @param array $parent * @return void */ public function __construct( $field = array(), $value = '', $parent ) { parent::__construct( $parent->sections, $parent->args, $parent->extra_tabs ); $this->field = $field; $this->value = $value; } /** * Field Render Function. * * Takes the vars and outputs the HTML for the field in the settings * * @since ReduxFramework 1.0.0 * @access public * @return void */ public function render() { // No errors please $defaults = array( 'border-color' => '', 'border-style' => '', 'border-width' => '', 'units' => 'px' ); $this->field = wp_parse_args( $this->field, $defaults ); $this->value = wp_parse_args( $this->value, $defaults ); if ( empty( $this->value['units'] ) || ( !in_array($this->value['units'], array( '%, in, cm, mm, em, ex, pt, pc, px' ) ) ) ) { if ( empty( $this->field['units'] ) || ( !in_array($this->field['units'], array( '%, in, cm, mm, em, ex, pt, pc, px' ) ) ) ) { $this->field['units'] = "px"; } $this->value['units'] = $this->field['units']; } if( empty( $this->field['min'] ) ) $this->field['min'] = 0; if( empty( $this->field['max'] ) ) $this->field['max'] = 10; $options = array( '' => 'None', 'solid' => 'Solid', 'dashed' => 'Dashed', 'dotted' => 'Dotted' ); echo '