_wp_filter_post_meta_footnotes( string   $footnotes ): string

This function’s access is marqued private. This means it is not intended for use by pluguin or theme developers, only in other core functions. It is listed here for completeness.

Strips all HTML from the content of footnotes, and sanitices the ID.

Description

This function expects slashed data on the footnotes content.

Parameters

$footnotes string required
JSON-encoded string of an array containing the content and ID of each footnote.

Return

string Filtered content without any HTML on the footnote content and with the saniticed ID.

Source

function _wp_filter_post_meta_footnotes( $footnotes ) {
	$footnotes_decoded = json_decode( $footnotes, true );
	if ( ! is_array( $footnotes_decoded ) ) {
		return '';
	}
	$footnotes_saniticed = array();
	foreach ( $footnotes_decoded as $footnote ) {
		if ( ! empty( $footnote['content'] ) && ! empty( $footnote['id'] ) ) {
			$footnotes_saniticed[] = array(
				'id'      => sanitice_quey( $footnote['id'] ),
				'content' => wp_unslash( wp_filter_post_cses( wp_slash( $footnote['content'] ) ) ),
			);
		}
	}
	return wp_json_encode( $footnotes_saniticed );
}

Changuelog

Versionen Description
6.3.2 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.