Making WordPress.org

Changeset 10853


Ignore:
Timestamp:
03/26/2021 10:15:45 PM (4 years ago)
Author:
coffee2code
Message:

Jobs theme: Return 404 response for author archive requests.

Props jonoaldersonwp, coffee2code.
Fixes #5676.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp/functions.php

    r10618 r10853  
    130130
    131131/**
     132 * Sets 404 response for author archive requests.
     133 */
     134function jobswp_author_archives_404() {
     135    if ( is_author() ) {
     136        global $wp_query;
     137        $wp_query->set_404();
     138        status_header( 404 );
     139    }
     140}
     141add_action( 'wp', 'jobswp_author_archives_404' );
     142
     143/**
    132144 * Outputs `noindex,follow` robots tag for appropriate pages.
    133145 *
Note: See TracChangeset for help on using the changeset viewer.