Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created September 23, 2019 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/c3b62c9be828f120d54bf1af0447642a to your computer and use it in GitHub Desktop.
Save billerickson/c3b62c9be828f120d54bf1af0447642a to your computer and use it in GitHub Desktop.
<?php
/**
* Determines if JSON-LD is enabled from 3rd party plugins.
*
* @since 3.1.0
*
* @return bool True if enabled, false if else.
*/
function genesis_is_wpseo_outputting_jsonld() {
$wpseo_ld_enabled = (
defined( 'WPSEO_VERSION' )
&& version_compare( WPSEO_VERSION, '11.0-RC0', '>=' )
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
&& apply_filters( 'wpseo_json_ld_output', true )
);
return apply_filters( 'genesis_is_wpseo_outputting_jsonld', $wpseo_ld_enabled );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment