Skip to content

Commit

Permalink
add a line break to try to retrigger the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Jun 21, 2021
1 parent 1d4bbf7 commit 74e6370
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ function bootstrap( Module $module ) {
// Remove Yoast SEO dashboard widget.
add_action( 'admin_init', __NAMESPACE__ . '\\remove_yoast_dashboard_widget' );

// Remove the Yoast Premium submenu page.
add_action( 'admin_init', __NAMESPACE__ . '\\remove_yoast_submenu_page' );

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

// Hide the HUGE SEO ISSUE warning and disable admin bar menu.
add_filter( 'pre_option_wpseo', __NAMESPACE__ . '\\override_yoast_seo_options' );

// Read config/robots.txt file into robots.txt route handled by WP.
add_filter( 'robots_txt', __NAMESPACE__ . '\\robots_txt', 10 );

Expand Down Expand Up @@ -103,6 +112,13 @@ function remove_yoast_dashboard_widget() {
wp_dequeue_style( 'wp-dashboard' );
}

/**
* Remove the Premium submenu.
*/
function remove_yoast_submenu_page() {
remove_submenu_page( 'wpseo_dashboard', 'wpseo_licenses' );
}

/**
* Load the SEO metadata plugin.
*
Expand Down Expand Up @@ -193,6 +209,27 @@ function metadata_img_as_tachyon( array $meta, array $img_settings = [] ) : arra
return $meta;
}

/**
* Override the Yoast SEO options.
*
* Disables the Search Engines Discouraged warning on non-production environments and the admin bar menu.
*
* @param mixed $options The option to retrieve.
*
* @return array The updated WPSEO options.
*/
function override_yoast_seo_options( $options ) : ?array {
$options['enable_admin_bar_menu'] = false;

if ( Altis\get_environment_type() === 'production' ) {
return $options;
}

$options['ignore_search_engines_discouraged_notice'] = true;

return $options;
}

/**
* Add robots.txt content if file is present.
*
Expand Down Expand Up @@ -277,6 +314,7 @@ function hide_yoast_premium_social_previews() {

/**
* Hide the Social tab in the Yoast Metabox.
*
* The Google preview is in the basic SEO tab and social previews
* are only available for Yoast SEO Premium.
*/
Expand Down

0 comments on commit 74e6370

Please sign in to comment.