Making WordPress.org

Changeset 10385

Timestamp:
10/16/2020 07:02:54 AM (4 years ago)
Author:
dd32
Message:

Open-source a bunch of redirects that were in sunrise.php (and a handful of similarly related redirects that didn't exist).

This will hopefully allow simpler recording of some of the generic redirects that are active, and may allow others to easier add/patch them.

See #5345.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php

    r9868 r10385  
    66if ( 1 === get_current_blog_id() ) {
    77    add_action( 'template_redirect', function() {
     8
    89        if ( is_feed() ) {
    9             // WordPress.org/feed/* should redirect to WordPress.org/news/feed/*
    1010            wp_safe_redirect( '/news/feed/' . ( 'feed' !== get_query_var('feed') ? get_query_var('feed') : '' ), 301 );
    1111            exit;
     12
     13
    1214        } elseif ( is_search() ) {
    1315            wp_safe_redirect( '/search/' . urlencode( get_query_var('s') ), 301 );
    1416            exit;
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
    1548        }
    1649    }, 9 ); // Before redirect_canonical();
    1750}
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
Note: See TracChangeset for help on using the changeset viewer.