← All changes
|
Libs/adminify-framework/fields/callback/callback.php
+13
-17
4.2.5
→
3.1.9
View file →
| @@ -1,5 +1,6 @@ | ||
| 1 | -<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly. | |
| 1 | +<?php if ( ! defined( 'ABSPATH' ) ) { | |
| 2 | + die; } // Cannot access directly. | |
| 2 | 3 | /** |
| 3 | 4 | * |
| 4 | 5 | * Field: callback |
| 5 | 6 | * |
| @@ -4,28 +5,23 @@ | ||
| 4 | 5 | * Field: callback |
| 5 | 6 | * |
| 6 | 7 | * @since 1.0.0 |
| 7 | 8 | * @version 1.0.0 |
| 8 | - * | |
| 9 | 9 | */ |
| 10 | 10 | if ( ! class_exists( 'ADMINIFY_Field_callback' ) ) { |
| 11 | - class ADMINIFY_Field_callback extends ADMINIFY_Fields { | |
| 11 | + class ADMINIFY_Field_callback extends ADMINIFY_Fields { | |
| 12 | 12 | |
| 13 | - public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) { | |
| 14 | - parent::__construct( $field, $value, $unique, $where, $parent ); | |
| 15 | - } | |
| 13 | + public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) { | |
| 14 | + parent::__construct( $field, $value, $unique, $where, $parent ); | |
| 15 | + } | |
| 16 | 16 | |
| 17 | - public function render() { | |
| 17 | + public function render() { | |
| 18 | + if ( isset( $this->field['function'] ) && is_callable( $this->field['function'] ) ) { | |
| 19 | + $args = ( isset( $this->field['args'] ) ) ? $this->field['args'] : null; | |
| 18 | 20 | |
| 19 | - if ( isset( $this->field['function'] ) && is_callable( $this->field['function'] ) ) { | |
| 21 | + call_user_func( $this->field['function'], $args ); | |
| 22 | + } | |
| 23 | + } | |
| 20 | 24 | |
| 21 | - $args = ( isset( $this->field['args'] ) ) ? $this->field['args'] : null; | |
| 22 | - | |
| 23 | - call_user_func( $this->field['function'], $args ); | |
| 24 | - | |
| 25 | - } | |
| 26 | - | |
| 27 | - } | |
| 28 | - | |
| 29 | - } | |
| 25 | + } | |
| 30 | 26 | } |
| 31 | 27 | |