You appear to be a bot. Output may be restricted
Description
Returns whether or not a blog crumb should be added.
Usage
$bool = Breadcrumbs_Generator::should_have_blog_crumb( $page_for_posts, $context );
Parameters
- $page_for_posts
- ( int ) required – The page for posts ID.
- $context
- ( Meta_Tags_Context ) required – The meta tags context.
Returns
bool Whether or not a blog crumb should be added.
Source
File name: wordpress-seo/src/generators/breadcrumbs-generator.php
Lines:
1 to 22 of 22
protected function should_have_blog_crumb( $page_for_posts, $context ) { // When there is no page configured as blog page. if ( \get_option( 'show_on_front' ) !== 'page' || ! $page_for_posts ) { return false; } if ( $context->indexable->object_type === 'term' ) { $parent = $this->get_taxonomy_post_type_parent( $context->indexable->object_sub_type ); return $parent === 'post'; } if ( $this->options->get( 'breadcrumbs-display-blog-page' ) !== true ) { return false; } // When the current page is the home page, searchpage or isn't a singular post. if ( \is_home() || \is_search() || ! \is_singular( 'post' ) ) { return false; } return true; }