• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Breadcrumb::is_needed() – Determine if we should add a breadcrumb attribute.

You appear to be a bot. Output may be restricted

Description

Determine if we should add a breadcrumb attribute.

Usage

$bool = Breadcrumb::is_needed();

Parameters

Returns

bool

Source

File name: wordpress-seo/src/generators/schema/breadcrumb.php
Lines:

1 to 15 of 15
  public function is_needed() {
    if ( $this->context->indexable->object_type === 'system-page' && $this->context->indexable->object_sub_type === '404' ) {
      return false;
    }

    if ( $this->context->indexable->object_type === 'home-page' || $this->helpers->current_page->is_home_static_page() ) {
      return false;
    }

    if ( $this->context->breadcrumbs_enabled ) {
      return true;
    }

    return false;
  }
 

 View on GitHub View on Trac

Published: 2nd May 2020 | Last updated: 15th June 2020

Primary Sidebar

Information

Function name: Breadcrumb::is_needed
Class ref: Breadcrumb
Plugin ref: Yoast SEO
Version: 15.4
Sourcefile: src/generators/schema/breadcrumb.php
File ref: src/generators/schema/breadcrumb.php
Deprecated?: No
API Letters: B,I,N

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites