Could be called directly by a plugin or theme.
public element_markup ( array $values = [] ) : string | ||
$values | array | the current values of this element, in a tree structure if the element has children. |
Результат | string | HTML for all form elements. |
/** * Render the field. * * @param array $args { * Optional. Arguments to adjust the rendering behavior. * * @type mixed $data The existing data to display with the field. If * absent, data will be loaded using * Fieldmanager_Context::_load(). * @type boolean $echo Output if true, return if false. Default is true. * } * @return string if $args['echo'] == false. */ protected function render_field($args = array()) { $data = array_key_exists('data', $args) ? $args['data'] : null; $echo = isset($args['echo']) ? $args['echo'] : true; $nonce = wp_nonce_field('fieldmanager-save-' . $this->fm->name, 'fieldmanager-' . $this->fm->name . '-nonce', true, false); $field = $this->fm->element_markup($data); if ($echo) { echo $nonce . $field; } else { return $nonce . $field; } }