get_description example

$return = $this->sanitize($tags[0]['data']$this->registry->call('Misc', 'atom_03_construct_type', array($tags[0]['attribs']))$this->get_base($tags[0]))))
        {
            return $return;
        }
        elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) &&
                ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))
        {
            return $return;
        }
        elseif (!$content_only)
        {
            return $this->get_description(true);
        }

        return null;
    }

    /** * Get the media:thumbnail of the item * * Uses `<media:thumbnail>` * * * @return array|null */
// Self-URL destruction sequence.         if ( in_array( untrailingslashit( $url ), array( site_url()home_url() ), true ) ) {
            return;
        }

        $rss   = fetch_feed( $url );
        $title = $instance['title'];
        $desc  = '';
        $link  = '';

        if ( ! is_wp_error( $rss ) ) {
            $desc = esc_attr( strip_tags( html_entity_decode( $rss->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ) ) );
            if ( empty( $title ) ) {
                $title = strip_tags( $rss->get_title() );
            }
            $link = strip_tags( $rss->get_permalink() );
            while ( ! empty( $link ) && stristr( $link, 'http' ) !== $link ) {
                $link = substr( $link, 1 );
            }
        }

        if ( empty( $title ) ) {
            $title = ! empty( $desc ) ? $desc : __( 'Unknown Feed' );
        }
// Cache the valid response.             $this->set_cache( $cache_key$remote_url_response );
        }

        $html_head     = $this->get_document_head( $remote_url_response );
        $meta_elements = $this->get_meta_with_content_elements( $html_head );

        $data = $this->add_additional_fields_to_object(
            array(
                'title'       => $this->get_title( $html_head ),
                'icon'        => $this->get_icon( $html_head$url ),
                'description' => $this->get_description( $meta_elements ),
                'image'       => $this->get_image( $meta_elements$url ),
            ),
            $request
        );

        // Wrap the data in a response object.         $response = rest_ensure_response( $data );

        /** * Filters the URL data for the response. * * @since 5.9.0 * * @param WP_REST_Response $response The response object. * @param string $url The requested URL. * @param WP_REST_Request $request Request object. * @param string $remote_url_response HTTP response body from the remote URL. */
$link = $item->get_link();
        while ( ! empty( $link ) && stristr( $link, 'http' ) !== $link ) {
            $link = substr( $link, 1 );
        }
        $link = esc_url( strip_tags( $link ) );

        $title = esc_html( trim( strip_tags( $item->get_title() ) ) );
        if ( empty( $title ) ) {
            $title = __( 'Untitled' );
        }

        $desc = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );
        $desc = esc_attr( wp_trim_words( $desc, 55, ' [&hellip;]' ) );

        $summary = '';
        if ( $show_summary ) {
            $summary = $desc;

            // Change existing [...] to [&hellip;].             if ( str_ends_with( $summary, '[...]' ) ) {
                $summary = substr( $summary, 0, -5 ) . '[&hellip;]';
            }

            
if ( str_starts_with( $plugin_slug$slug ) ) {
                    unset( $items[$item_key] );
                    continue 2;
                }
            }

            // If we get to this point, then the random plugin isn't installed and we can stop the while().             break;
        }

        // Eliminate some common badly formed plugin descriptions.         while ( ( null !== $item_key = array_rand($items) ) && str_contains( $items[$item_key]->get_description(), 'Plugin Name:' ) )
            unset($items[$item_key]);

        if ( !isset($items[$item_key]) )
            continue;

        $raw_title = $item->get_title();

        $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
        echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
            '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
            /* translators: %s: Plugin name. */
            
$author = $author->get_name();
                $author = '<span class="wp-block-rss__item-author">' . sprintf(
                    /* translators: %s: the author. */
                    __( 'by %s' ),
                    esc_html( strip_tags( $author ) )
                ) . '</span>';
            }
        }

        $excerpt = '';
        if ( $attributes['displayExcerpt'] ) {
            $excerpt = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );
            $excerpt = esc_attr( wp_trim_words( $excerpt$attributes['excerptLength'], ' [&hellip;]' ) );

            // Change existing [...] to [&hellip;].             if ( '[...]' === substr( $excerpt, -5 ) ) {
                $excerpt = substr( $excerpt, 0, -5 ) . '[&hellip;]';
            }

            $excerpt = '<div class="wp-block-rss__item-excerpt">' . esc_html( $excerpt ) . '</div>';
        }

        $list_items .= "<li class='wp-block-rss__item'>{$title}{$date}{$author}{$excerpt}</li>";
    }
Home | Imprint | This part of the site doesn't use cookies.