Skip to main content

rwmb_end_html

This filter is similar to rwmb_begin_html and is used to change the ending HTML output of a field.

When outputting a field, it will have the following HTML:

<!-- Start: field outer HTML -->
{$field['before']}
<div class="rwmb-field rwmb-{$field['type']}-wrapper {$field['class']} required">

<!-- Start: field wrapper HTML -->

<!-- Start: field begin HTML -->
<div class="rwmb-label" id="{$field['id]}-label">
<label for="{$field['id']}">
{$field['name']}
<span class="rwmb-required">*</span>
</label>
<p id="{$field['id']}-label-description" class="description">{$field['label_description']}</p>
</div>
<div class="rwmb-input">
<!-- End: field begin HTML -->


<!-- Field input HTML -->


<!-- Start: field end HTML -->
{$add_clone_button}
<p id="{$field['id']}-description" class="description">{$field['desc']}</p>
</div>
<!-- End: field end HTML -->

<!-- End: field wrapper HTML -->


</div>
{$field['after']}
<!-- End: field outer HTML -->

The ending HTML for a field looks like this:

    {$add_clone_button}
<p id="{$field['id']}-description" class="description">{$field['desc']}</p>
</div><!-- .rwmb-input -->

Syntax:

apply_filters( 'rwmb_end_html', $end, $field, $value );

This filter accepts 3 parameters:

NameDescription
$endThe ending HTML output of the field
$fieldField settings
$valueField value

This filter has variations:

  • rwmb_end_html: apply to all fields
  • rwmb_{$field_type}_end_html: apply to fields with a specific type
  • rwmb_{$field_id}_end_html: apply to a field with a specific id