html.php
42 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Html Markup |
| 4 | * |
| 5 | * @package factory-forms |
| 6 | * @since 1.0.0 |
| 7 | */ |
| 8 | |
| 9 | // Exit if accessed directly |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | if ( ! class_exists( 'Wbcr_FactoryForms600_Html' ) ) { |
| 15 | |
| 16 | class Wbcr_FactoryForms600_Html extends Wbcr_FactoryForms600_CustomElement { |
| 17 | |
| 18 | public $type = 'html'; |
| 19 | |
| 20 | /** |
| 21 | * Shows the html markup of the element. |
| 22 | * |
| 23 | * @since 1.0.0 |
| 24 | * @return void |
| 25 | */ |
| 26 | public function html() { |
| 27 | $html = $this->getOption( 'html', '' ); |
| 28 | |
| 29 | // if the data options is a valid callback for an object method |
| 30 | if ( ( is_array( $html ) && count( $html ) == 2 && gettype( $html[0] ) == 'object' ) || function_exists( $html ) ) { |
| 31 | |
| 32 | call_user_func( $html, $this ); |
| 33 | |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | // if the data options is an array of values |
| 38 | echo $html; |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 |