wp_lazy_loading_enabled example

$title = apply_filters( 'widget_title', $title$instance$this->id_base );

        if ( $title ) {
            $feed_link = '';
            $feed_url  = strip_tags( $url );
            $feed_icon = includes_url( 'images/rss.png' );
            $feed_link = sprintf(
                '<a class="rsswidget rss-widget-feed" href="%1$s"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="%2$s" alt="%3$s"%4$s /></a> ',
                esc_url( $feed_url ),
                esc_url( $feed_icon ),
                esc_attr__( 'RSS' ),
                ( wp_lazy_loading_enabled( 'img', 'rss_widget_feed_icon' ) ? ' loading="lazy"' : '' )
            );

            /** * Filters the classic RSS widget's feed icon link. * * Themes can remove the icon link by using `add_filter( 'rss_widget_feed_link', '__return_empty_string' );`. * * @since 5.9.0 * * @param string|false $feed_link HTML for link to RSS feed. * @param array $instance Array of settings for the current widget. */

    $show_site_icons = apply_filters( 'wp_admin_bar_show_site_icons', true );

    foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
        switch_to_blog( $blog->userblog_id );

        if ( true === $show_site_icons && has_site_icon() ) {
            $blavatar = sprintf(
                '<img class="blavatar" src="%s" srcset="%s 2x" alt="" width="16" height="16"%s />',
                esc_url( get_site_icon_url( 16 ) ),
                esc_url( get_site_icon_url( 32 ) ),
                ( wp_lazy_loading_enabled( 'img', 'site_icon_in_toolbar' ) ? ' loading="lazy"' : '' )
            );
        } else {
            $blavatar = '<div class="blavatar"></div>';
        }

        $blogname = $blog->blogname;

        if ( ! $blogname ) {
            $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
        }

        

function wp_filter_content_tags( $content$context = null ) {
    if ( null === $context ) {
        $context = current_filter();
    }

    $add_iframe_loading_attr = wp_lazy_loading_enabled( 'iframe', $context );

    if ( ! preg_match_all( '/<(img|iframe)\s[^>]+>/', $content$matches, PREG_SET_ORDER ) ) {
        return $content;
    }

    // List of the unique `img` tags found in $content.     $images = array();

    // List of the unique `iframe` tags found in $content.     $iframes = array();

    
Home | Imprint | This part of the site doesn't use cookies.