wp_kses_no_null example


function wp_kses( $content$allowed_html$allowed_protocols = array() ) {
    if ( empty( $allowed_protocols ) ) {
        $allowed_protocols = wp_allowed_protocols();
    }

    $content = wp_kses_no_null( $content, array( 'slash_zero' => 'keep' ) );
    $content = wp_kses_normalize_entities( $content );
    $content = wp_kses_hook( $content$allowed_html$allowed_protocols );

    return wp_kses_split( $content$allowed_html$allowed_protocols );
}

/** * Filters one HTML attribute and ensures its value is allowed. * * This function can escape data in some situations where `wp_kses()` must strip the whole attribute. * * @since 4.2.3 * * @param string $attr The 'whole' attribute, including name and value. * @param string $element The HTML element name to which the attribute belongs. * @return string Filtered attribute. */
$page_no = $elements['page'];
    $content = $elements['pages'][ $page_no - 1 ];
    if ( preg_match( '/<!--more(.*?)?-->/', $content$matches ) ) {
        if ( has_block( 'more', $content ) ) {
            // Remove the core/more block delimiters. They will be left over after $content is split up.             $content = preg_replace( '/<!-- \/?wp:more(.*?) -->/', '', $content );
        }

        $content = explode( $matches[0]$content, 2 );

        if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) ) {
            $more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
        }

        $has_teaser = true;
    } else {
        $content = array( $content );
    }

    if ( str_contains( $_post->post_content, '<!--noteaser-->' ) && ( ! $elements['multipage'] || 1 == $elements['page'] ) ) {
        $strip_teaser = true;
    }

    

        $location = preg_replace_callback( $regex, '_wp_sanitize_utf8_in_redirect', $location );
        $location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location );
        $location = wp_kses_no_null( $location );

        // Remove %0D and %0A from location.         $strip = array( '%0d', '%0a', '%0D', '%0A' );
        return _deep_replace( $strip$location );
    }

    /** * URL encodes UTF-8 characters in a URL. * * @ignore * @since 4.2.0 * @access private * * @see wp_sanitize_redirect() * * @param array $matches RegEx matches against the redirect location. * @return string URL-encoded version of the first RegEx match. */
Home | Imprint | This part of the site doesn't use cookies.