_wp_filter_post_meta_footnotes

The timeline below displays how wordpress function _wp_filter_post_meta_footnotes has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Strips all HTML from the content of footnotes, and sanitizes the ID.
 *
 * This function expects slashed data on the footnotes content.
 *
 * @access private
 * @since 6.3.2
 *
 * @param string $footnotes 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 sanitized ID.
 */
function _wp_filter_post_meta_footnotes($footnotes)
{
    $footnotes_decoded = json_decode($footnotes, true);
    if (!is_array($footnotes_decoded)) {
        return '';
    }
    $footnotes_sanitized = array();
    foreach ($footnotes_decoded as $footnote) {
        if (!empty($footnote['content']) && !empty($footnote['id'])) {
            $footnotes_sanitized[] = array('id' => sanitize_key($footnote['id']), 'content' => wp_unslash(wp_filter_post_kses(wp_slash($footnote['content']))));
        }
    }
    return wp_json_encode($footnotes_sanitized);
}

WordPress Version: 3.2

/**
 * Strips all HTML from the content of footnotes, and sanitizes the ID.
 * This function expects slashed data on the footnotes content.
 *
 * @access private
 * @since 6.3.2
 *
 * @param string $footnotes 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 sanitized id.
 */
function _wp_filter_post_meta_footnotes($footnotes)
{
    $footnotes_decoded = json_decode($footnotes, true);
    if (!is_array($footnotes_decoded)) {
        return '';
    }
    $footnotes_sanitized = array();
    foreach ($footnotes_decoded as $footnote) {
        if (!empty($footnote['content']) && !empty($footnote['id'])) {
            $footnotes_sanitized[] = array('id' => sanitize_key($footnote['id']), 'content' => wp_unslash(wp_filter_post_kses(wp_slash($footnote['content']))));
        }
    }
    return wp_json_encode($footnotes_sanitized);
}