wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



format_to_edit › WordPress Function

Od0.71
Przestarzałyn/a
format_to_edit ( $content, $rich_text = false )
Parametry: (2)
  • (string) $content The text about to be edited.
    Wymagane: Tak
  • (bool) $rich_text Optional. Whether `$content` should be considered rich text, in which case it would not be passed through esc_textarea(). Default false.
    Wymagane: Nie
    Domyślny: false
Powrót:
  • (string) The text after the filter (and possibly htmlspecialchars()) has been run.
Zdefiniowane na:
Codex:
Dziennik zmian:
  • 4.4.0

Acts on text which is about to be edited.

The $content is run through esc_textarea(), which uses htmlspecialchars() to convert special characters to HTML entities. If $richedit is set to true, it is simply a holder for the {@see 'format_to_edit'} filter.


Źródło

function format_to_edit( $content, $rich_text = false ) {
	/**
	 * Filters the text to be formatted for editing.
	 *
	 * @since 1.2.0
	 *
	 * @param string $content The text, prior to formatting for editing.
	 */
	$content = apply_filters( 'format_to_edit', $content );
	if ( ! $rich_text ) {
		$content = esc_textarea( $content );
	}
	return $content;
}