Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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;
- }
- }
Add Comment
Please, Sign In to add comment