get_link example

$items = $feed->get_items(0, 5);

        // Pick a random, non-installed plugin.         while ( true ) {
            // Abort this foreach loop iteration if there's no plugins left of this type.             if ( 0 === count($items) )
                continue 2;

            $item_key = array_rand($items);
            $item = $items[$item_key];

            list($link$frag) = explode( '#', $item->get_link() );

            $link = esc_url($link);
            if ( preg_match( '|/([^/]+?)/?$|', $link$matches ) )
                $slug = $matches[1];
            else {
                unset( $items[$item_key] );
                continue;
            }

            // Is this random plugin's slug already installed? If so, try again.             reset( $plugin_slugs );
            

    public function get_permalink()
    {
        $link = $this->get_link();
        $enclosure = $this->get_enclosure(0);
        if ($link !== null)
        {
            return $link;
        }
        elseif ($enclosure !== null)
        {
            return $enclosure->get_link();
        }

        return null;
    }

    public function get_base($element = array())
    {
        if (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base']))
        {
            return $element['xml_base'];
        }
        elseif ($this->get_link() !== null)
        {
            return $this->get_link();
        }

        return $this->subscribe_url();
    }

    /** * Sanitize feed data * * @access private * @see SimplePie_Sanitize::sanitize() * @param string $data Data to sanitize * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants * @param string $base Base URL to resolve URLs against * @return string Sanitized data */

            $placeholder = $video;
        }

        $embed = '';

        // Flash         if ($handler === 'flash')
        {
            if ($native)
            {
                $embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>";
            }
            else
            {
                $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>";
            }
        }

        // Flash Media Player file types.         // Preferred handler for MP3 file types.         elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== ''))
        {
            


    /** * Render the data link attribute for the control's input element. * * @since 3.4.0 * @uses WP_Customize_Control::get_link() * * @param string $setting_key */
    public function link( $setting_key = 'default' ) {
        echo $this->get_link( $setting_key );
    }

    /** * Render the custom attributes for the control's input element. * * @since 4.0.0 */
    public function input_attrs() {
        foreach ( $this->input_attrs as $attr => $value ) {
            echo $attr . '="' . esc_attr( $value ) . '" ';
        }
    }
return $links[$key];
        }

        return null;
    }

    /** * Added for parity between the parent-level and the item/entry-level. */
    public function get_permalink()
    {
        return $this->get_link(0);
    }

    public function get_links($rel = 'alternate')
    {
        if (!isset($this->data['links']))
        {
            $this->data['links'] = array();
            if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))
            {
                foreach ($links as $link)
                {
                    
$show_date    = (int) $args['show_date'];

    if ( ! $rss->get_item_quantity() ) {
        echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</li></ul>';
        $rss->__destruct();
        unset( $rss );
        return;
    }

    echo '<ul>';
    foreach ( $rss->get_items( 0, $items ) as $item ) {
        $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' ) );
        
if ( ! $rss->get_item_quantity() ) {
        return '<div class="components-placeholder"><div class="notice notice-error">' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</div></div>';
    }

    $rss_items  = $rss->get_items( 0, $attributes['itemsToShow'] );
    $list_items = '';
    foreach ( $rss_items as $item ) {
        $title = esc_html( trim( strip_tags( $item->get_title() ) ) );
        if ( empty( $title ) ) {
            $title = __( '(no title)' );
        }
        $link = $item->get_link();
        $link = esc_url( $link );
        if ( $link ) {
            $title = "<a href='{$link}'>{$title}</a>";
        }
        $title = "<div class='wp-block-rss__item-title'>{$title}</div>";

        $date = '';
        if ( $attributes['displayDate'] ) {
            $date = $item->get_date( 'U' );

            if ( $date ) {
                
Home | Imprint | This part of the site doesn't use cookies.