Skip to content

Commit

Permalink
Merge pull request #159 from humanmade/backport-158-to-v9-branch
Browse files Browse the repository at this point in the history
[Backport v9-branch] Use `WPSEO_DEBUG` for pretty printing JSON+LD
  • Loading branch information
Robin Devitt authored Nov 22, 2021
2 parents 6d6a87d + 437bf2d commit f52014d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function bootstrap( Module $module ) {
add_action( 'admin_init', __NAMESPACE__ . '\\remove_yoast_submenu_page' );

// Pretty print the JSON+LD schema output.
add_action( 'muplugins_loaded', __NAMESPACE__ . '\\enable_yoast_development_mode' );
add_action( 'muplugins_loaded', __NAMESPACE__ . '\\enable_yoast_debug_mode' );

// Remove Helpscout.
add_filter( 'wpseo_helpscout_show_beacon', '__return_false' );
Expand Down Expand Up @@ -340,13 +340,15 @@ function social_options_overridden_notice() {
}

/**
* Enable Yoast Development Mode.
* Enable Yoast Debug Mode.
*
* Yoast development mode will pretty print the yoast-schema-graph HTML.
* Yoast debug mode will pretty print the yoast-schema-graph HTML.
*/
function enable_yoast_development_mode() {
function enable_yoast_debug_mode() {
if ( Altis\get_environment_type() !== 'production' ) {
define( 'YOAST_ENVIRONMENT', 'development' );
if ( ! defined( 'WPSEO_DEBUG' ) ) {
define( 'WPSEO_DEBUG', true );
}
}
}

Expand Down

0 comments on commit f52014d

Please sign in to comment.