W3cubDocs

/WordPress

PO::comment_block( string $text, string $char = ‘ ‘ )

Prepare a text as a comment — wraps the lines and prepends # and a special character to each line

Parameters

$textstringrequired
the comment text
$charstringoptional
character to denote a special PO comment, like :, default is a space

Default:' '

Source

public static function comment_block( $text, $char = ' ' ) {
	$text = wordwrap( $text, PO_MAX_LINE_LEN - 3 );
	return PO::prepend_each_line( $text, "#$char " );
}

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/po/comment_block