Skip to content
All gists
Back to GitHub
Sign in
Sign up
Sign in
Sign up
{{ message }}
Instantly share code, notes, and snippets.
schemapress
/
schema-wp-breadcrumb-enable.php
Last active
October 20, 2017 22:51
Star
0
Fork
0
Star
Code
Revisions
3
Embed
What would you like to do?
Embed
Embed this gist in your website.
Share
Copy sharable link for this gist.
Clone via HTTPS
Clone with Git or checkout with SVN using the repository’s web address.
Learn more about clone URLs
Download ZIP
Disable Schema plugin breadcrumbs
https://schema.press/docs/breadcrumb-output/
Raw
schema-wp-breadcrumb-enable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
<?php //* do not include php tag
/*
* A few ways to disable Schema plugin breadcrumbs json-ld output
*
* @since 1.6.9.5
*/
//------------------- (1)
//
// This will add a filter on `schema_wp_breadcrumb_enabled` that returns false
add_filter( 'schema_wp_breadcrumb_enabled', '__return_false' );
//------------------- (2)
//
// This will add a filter on `schema_wp_breadcrumb_enabled` that returns false
// but allow you to something in the function (see next function #3 for example)
add_filter( 'schema_wp_breadcrumb_enabled', 'schema_wp_breadcrumb_disable_238746' );
/*
* Disable breadcrumbs
*
* @since 1.6.9.5
*/
function schema_wp_breadcrumb_disable_238746( $breadcrumb_enabled ){
return false;
}
//------------------- (3)
//
// This will add a filter on `schema_wp_breadcrumb_enabled` that returns false,
// This example will disable breadcrumbs on WooCommerce
add_filter( 'schema_wp_breadcrumb_enabled', 'schema_wp_breadcrumb_woo_product_disable' );
/*
* Disable breadcrumbs on WooCommerce
*
* @since 1.6.9.5
*/
function schema_wp_breadcrumb_woo_product_disable( $breadcrumb_enabled ){
if ( class_exists( 'woocommerce' ) ) {
if ( is_woocommerce() ) return false;
}
}
Sign up for free
to join this conversation on GitHub
. Already have an account?
Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.