Skip to content

Commit

Permalink
Merge pull request #106 from humanmade/yoast-dev-mode
Browse files Browse the repository at this point in the history
Add support for Yoast developer mode
  • Loading branch information
roborourke authored Sep 27, 2021
2 parents 863ec92 + cd8dab7 commit 2603d12
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ function bootstrap( Module $module ) {
// Remove the Yoast Premium submenu page.
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' );

// Remove Helpscout.
add_filter( 'wpseo_helpscout_show_beacon', '__return_false' );

Expand Down Expand Up @@ -330,6 +333,17 @@ function social_options_overridden_notice() {
wp_cache_set( 'has_displayed_social_notice', true, 'altis.seo' );
}

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

/**
* Add robots.txt content if file is present.
*
Expand Down

0 comments on commit 2603d12

Please sign in to comment.