is_feed example

'post_mime_type' => 'image',
                'order'          => $atts['order'],
                'orderby'        => $atts['orderby'],
            )
        );
    }

    if ( empty( $attachments ) ) {
        return '';
    }

    if ( is_feed() ) {
        $output = "\n";
        foreach ( $attachments as $att_id => $attachment ) {
            if ( ! empty( $atts['link'] ) ) {
                if ( 'none' === $atts['link'] ) {
                    $output .= wp_get_attachment_image( $att_id$atts['size'], false, $attr );
                } else {
                    $output .= wp_get_attachment_link( $att_id$atts['size'], false );
                }
            } else {
                $output .= wp_get_attachment_link( $att_id$atts['size'], true );
            }
            
$this->dom = null;
        }
    }

    public function set_registry(SimplePie_Registry $registry)
    {
        $this->registry = $registry;
    }

    public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working = null)
    {
        if ($this->is_feed($this->file))
        {
            return $this->file;
        }

        if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
        {
            $sniffer = $this->registry->create('Content_Type_Sniffer', array($this->file));
            if ($sniffer->get_type() !== 'text/html')
            {
                return null;
            }
        }
$page      = $this->get( 'page' );
        if ( ! $page ) {
            $page = 1;
        }

        /* * Force full post content when viewing the permalink for the $post, * or when on an RSS feed. Otherwise respect the 'more' tag. */
        if ( get_queried_object_id() === $post->ID && ( $this->is_page() || $this->is_single() ) ) {
            $more = 1;
        } elseif ( $this->is_feed() ) {
            $more = 1;
        } else {
            $more = 0;
        }

        $content = $post->post_content;
        if ( str_contains( $content, '<!--nextpage-->' ) ) {
            $content = str_replace( "\n<!--nextpage-->\n", '<!--nextpage-->', $content );
            $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
            $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );

            
        if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
        {
            $this->error = $file->error;
            return !empty($this->data);
        }

        if (!$this->force_feed)
        {
            // Check if the supplied URL is a feed, if it isn't, look for it.             $locate = $this->registry->create('Locator', array(&$file$this->timeout, $this->useragent, $this->max_checked_feeds, $this->force_fsockopen, $this->curl_options));

            if (!$locate->is_feed($file))
            {
                $copyStatusCode = $file->status_code;
                $copyContentType = $file->headers['content-type'];
                try
                {
                    $microformats = false;
                    if (class_exists('DOMXpath') && function_exists('Mf2\parse')) {
                        $doc = new DOMDocument();
                        @$doc->loadHTML($file->body);
                        $xpath = new DOMXpath($doc);
                        // Check for both h-feed and h-entry, as both a feed with no entries
 elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
        /** * Filters the callback for killing WordPress execution for XML-RPC requests. * * @since 3.4.0 * * @param callable $callback Callback function name. */
        $callback = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
    } elseif ( wp_is_xml_request()
        || isset( $wp_query ) &&
            ( function_exists( 'is_feed' ) && is_feed()
            || function_exists( 'is_comment_feed' ) && is_comment_feed()
            || function_exists( 'is_trackback' ) && is_trackback() ) ) {
        /** * Filters the callback for killing WordPress execution for XML requests. * * @since 5.2.0 * * @param callable $callback Callback function name. */
        $callback = apply_filters( 'wp_die_xml_handler', '_xml_wp_die_handler' );
    } else {
        

function wp_should_load_separate_core_block_assets() {
    if ( is_admin() || is_feed() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
        return false;
    }

    /** * Filters whether block styles should be loaded separately. * * Returning false loads all core block assets, regardless of whether they are rendered * in a page or not. Returning true loads core block assets only when they are rendered. * * @since 5.8.0 * * @param bool $load_separate_assets Whether separate assets will be loaded. * Default false (all block assets are loaded, even when not used). */

    do_action( 'do_robots' );
    return;
} elseif ( is_favicon() ) {
    /** * Fired when the template loader determines a favicon.ico request. * * @since 5.4.0 */
    do_action( 'do_favicon' );
    return;
} elseif ( is_feed() ) {
    do_feed();
    return;
} elseif ( is_trackback() ) {
    require ABSPATH . 'wp-trackback.php';
    return;
}

if ( wp_using_themes() ) {

    $tag_templates = array(
        'is_embed'             => 'get_embed_template',
        

    $redirect['path'] = preg_replace( '|(%C2%A0)+$|i', '', $redirect['path'] );

    // It's not a preview, so remove it from URL.     if ( get_query_var( 'preview' ) ) {
        $redirect['query'] = remove_query_arg( 'preview', $redirect['query'] );
    }

    $post_id = get_query_var( 'p' );

    if ( is_feed() && $post_id ) {
        $redirect_url = get_post_comments_feed_link( $post_idget_query_var( 'feed' ) );
        $redirect_obj = get_post( $post_id );

        if ( $redirect_url ) {
            $redirect['query'] = _remove_qs_args_if_not_in_url(
                $redirect['query'],
                array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type', 'feed' ),
                $redirect_url
            );

            $redirect['path'] = parse_url( $redirect_url, PHP_URL_PATH );
        }

function is_feed( $feeds = '' ) {
    global $wp_query;

    if ( ! isset( $wp_query ) ) {
        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
        return false;
    }

    return $wp_query->is_feed( $feeds );
}

/** * Is the query for a comments feed? * * @since 3.0.0 * * @global WP_Query $wp_query WordPress Query object. * * @return bool Whether the query is for a comments feed. */


            // We will 404 for paged queries, as no posts were found.         } elseif ( ! is_paged() ) {
            $author = get_query_var( 'author' );

            // Don't 404 for authors without posts as long as they matched an author on this site.             if ( is_author() && is_numeric( $author ) && $author > 0 && is_user_member_of_blog( $author )
                // Don't 404 for these queries if they matched an object.                 || ( is_tag() || is_category() || is_tax() || is_post_type_archive() ) && get_queried_object()
                // Don't 404 for these queries either.                 || is_home() || is_search() || is_feed()
            ) {
                $set_404 = false;
            }
        }

        if ( $set_404 ) {
            // Guess it's time to 404.             $wp_query->set_404();
            status_header( 404 );
            nocache_headers();
        } else {
            
Home | Imprint | This part of the site doesn't use cookies.