APIs on label and richtext output handling

Filter: ipt_uif_richtext

This filter is used to modify the richtext contents of element descriptions.

Filter Uses

Accepts one argument, the HTML string (rich text).

/**
 * Modifies RichText Elements inside all eForm output
 *
 * @param      string  $text   Original text/html
 *
 * @return     string
 */
function modify_fsqm_richtext( $text ) {
	// Perform some action to the text
	$text = str_replace( 'google', '<a href="http://google.com">Go Google</a>', $text );
	return $text;
}
add_filter( 'ipt_uif_richtext', 'modify_fsqm_richtext', 10, 1 );

Source

Located in multiple sources

Filter: ipt_uif_label

Used to modify the output of form elements’ labels.

Filter Uses

Accepts one parameter, the label HTML (string).

/**
 * Modifies labels inside all fsqm elements
 *
 * @param      string  $text   The label HTML
 *
 * @return     string
 */
function modify_fsqm_labels( $text ) {
	// Perform some action to the text
	if ( is_admin() ) {
		return $text;
	}

	$text = '<span class="my_label">' . $text . '</span>';
	return $text;
}
add_filter( 'ipt_uif_label', 'modify_fsqm_labels', 99, 1 );

Source

Located in multiple sources

Swashata has written 247 articles

Hi there, I am the Lead Developer at WPQuark.com. I love to create something beautiful for WordPress and here I write about how to use them. When I am not working, usually I am doing a number of other creative things ;).