No Description

web-stories.php 974B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Compatibility functions for the Web Stories plugin.
  4. * https://wordpress.org/plugins/web-stories/
  5. *
  6. * @since 9.2.0
  7. *
  8. * @package automattic/jetpack
  9. */
  10. namespace Automattic\Jetpack\Web_Stories;
  11. if ( ! defined( 'ABSPATH' ) ) {
  12. exit;
  13. }
  14. /**
  15. * Filter to enable web stories built in open graph data from being output.
  16. * If Jetpack is already handling Open Graph Meta Tags, the Web Stories plugin will not output any.
  17. *
  18. * @param bool $enabled If web stories open graph data is enabled.
  19. *
  20. * @return bool
  21. */
  22. function maybe_disable_open_graph( $enabled ) {
  23. /** This filter is documented in class.jetpack.php */
  24. $jetpack_enabled = apply_filters( 'jetpack_enable_open_graph', false );
  25. if ( $jetpack_enabled ) {
  26. $enabled = false;
  27. }
  28. return $enabled;
  29. }
  30. add_filter( 'web_stories_enable_open_graph_metadata', __NAMESPACE__ . '\maybe_disable_open_graph' );
  31. add_filter( 'web_stories_enable_twitter_metadata', __NAMESPACE__ . '\maybe_disable_open_graph' );