mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-03 02:48:45 +08:00
31 lines
732 B
PHP
Executable file
31 lines
732 B
PHP
Executable file
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
|
|
/**
|
|
*
|
|
* Field: callback
|
|
*
|
|
* @since 1.0.0
|
|
* @version 1.0.0
|
|
*
|
|
*/
|
|
if ( ! class_exists( 'WP_CHINA_YES_Field_callback' ) ) {
|
|
class WP_CHINA_YES_Field_callback extends WP_CHINA_YES_Fields {
|
|
|
|
public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
|
|
parent::__construct( $field, $value, $unique, $where, $parent );
|
|
}
|
|
|
|
public function render() {
|
|
|
|
if ( isset( $this->field['function'] ) && is_callable( $this->field['function'] ) ) {
|
|
|
|
$args = ( isset( $this->field['args'] ) ) ? $this->field['args'] : null;
|
|
|
|
call_user_func( $this->field['function'], $args );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|