Filter
rpress_after_setting_output
On this page
Filters the HTML output of a settings field before it is printed.
Runs inside the settings field callbacks (checkbox, multicheck, text, number, email, password, textarea, select, radio, rich editor, upload, colour, gateways, payment icons, shop states, descriptive text and header) after the field markup is built. The returned string is passed through wp_kses with a callback-specific allowed tag list, so tags or attributes outside that list are stripped. Use it to append content or modify the field based on $args['id'].
Parameters#
| Parameter | Type | Description |
|---|---|---|
$html | string | The field HTML built by the callback. Empty string for the header callback. |
$args | array | The setting arguments, including id, name, desc, type and std. |
Return value#
string. The HTML to print for the field.
Example#
function my_append_setting_note( $html, $args ) {
if ( isset( $args['id'] ) && 'currency' === $args['id'] ) {
$html .= '<p class="description">' . esc_html__( 'Changing the currency affects existing reports.', 'my-plugin' ) . '</p>';
}
return $html;
}
add_filter( 'rpress_after_setting_output', 'my_append_setting_note', 10, 2 );
Notes#
Fired from many field callbacks. Output is sanitised with wp_kses afterwards, and the allowed tags differ per field type. For the header callback the filtered value starts as an empty string.
Source#
Applied in:
includes/admin/settings/register-settings.php(line 2341), inrpress_header_callback()includes/admin/settings/register-settings.php(line 2371), inrpress_checkbox_callback()includes/admin/settings/register-settings.php(line 2444), inrpress_multicheck_callback()includes/admin/settings/register-settings.php(line 2518), inrpress_payment_icons_callback()includes/admin/settings/register-settings.php(line 2566), inrpress_radio_callback()includes/admin/settings/register-settings.php(line 2614), inrpress_gateways_callback()includes/admin/settings/register-settings.php(line 2657), inrpress_gateway_select_callback()includes/admin/settings/register-settings.php(line 2716), inrpress_text_callback()- and 11 more places.
