Guest User

Untitled

a guest
Oct 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <?php //* do not include php tag
  2.  
  3. /*
  4. * A few ways to disable Schema plugin breadcrumbs json-ld output
  5. *
  6. * @since 1.6.9.5
  7. */
  8.  
  9. //------------------- (1)
  10. //
  11. // This will add a filter on `schema_wp_breadcrumb_enabled` that returns false
  12. add_filter( 'schema_wp_breadcrumb_enabled', '__return_false' );
  13.  
  14. //------------------- (2)
  15. //
  16. // This will add a filter on `schema_wp_breadcrumb_enabled` that returns false
  17. // but allow you to something in the function (see next function #3 for example)
  18. add_filter( 'schema_wp_breadcrumb_enabled', 'schema_wp_breadcrumb_disable_238746' );
  19. /*
  20. * Disable breadcrumbs
  21. *
  22. * @since 1.6.9.5
  23. */
  24. function schema_wp_breadcrumb_disable_238746( $breadcrumb_enabled ){
  25.  
  26. return false;
  27. }
  28.  
  29. //------------------- (3)
  30. //
  31. // This will add a filter on `schema_wp_breadcrumb_enabled` that returns false,
  32. // This example will disable breadcrumbs on WooCommerce
  33. add_filter( 'schema_wp_breadcrumb_enabled', 'schema_wp_breadcrumb_woo_product_disable' );
  34. /*
  35. * Disable breadcrumbs on WooCommerce
  36. *
  37. * @since 1.6.9.5
  38. */
  39. function schema_wp_breadcrumb_woo_product_disable( $breadcrumb_enabled ){
  40.  
  41. if ( class_exists( 'woocommerce' ) ) {
  42. if ( is_woocommerce() ) return false;
  43. }
  44. }
Add Comment
Please, Sign In to add comment