Skip to content

Commit

Permalink
Plugin: Redirect deprecated Learn handbook to Training Team handbook
Browse files Browse the repository at this point in the history
See #2496
  • Loading branch information
adamwoodnz committed Aug 26, 2024
1 parent b536cb0 commit c332305
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions wp-content/plugins/wporg-learn/inc/redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @return array The updated array of allowed redirect hosts.
*/
function wporg_learn_allowed_redirect_hosts( $hosts ) {
return array_merge( $hosts, array( 'wordpress.tv' ) );
return array_merge( $hosts, array( 'wordpress.tv', 'make.wordpress.org' ) );
};

/**
Expand Down Expand Up @@ -51,14 +51,15 @@ function wporg_learn_redirect_old_urls() {

$redirects = array(
// Source => Destination, any characters after the source will be appended to the destination.
'/workshop/' => '/tutorial/',
'/workshops' => '/tutorials',
'/social-learning' => '/online-workshops',
'/workshop-presenter-application' => '/tutorial-presenter-application',
'/handbook' => 'https://make.wordpress.org/training/handbook/',
'/report-content-errors' => '/report-content-feedback',
'/social-learning' => '/online-workshops',
'/tutorial/block-editor-01-basics/' => 'https://wordpress.tv/2021/06/18/shusei-toda-naoko-takano-block-editor-01-basics/',
'/tutorial/block-editor-02-text-blocks/' => 'https://wordpress.tv/2021/06/03/shusei-toda-block-editor-02-text-blocks/',
'/tutorial/ja-login-password-reset/' => 'https://wordpress.tv/2021/02/16/login-password-reset/',
'/workshop/' => '/tutorial/',
'/workshop-presenter-application' => '/tutorial-presenter-application',
'/workshops' => '/tutorials',
);

// Use `REQUEST_URI` rather than `$wp->request`, to get the entire source URI including url parameters.
Expand Down

0 comments on commit c332305

Please sign in to comment.