Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericoAndrade committed Sep 15, 2024
2 parents 5e840a8 + 6556630 commit f771c17
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wp-content/themes/blankslate-child/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ function modify_page_title() {
}
add_action('wp_head', 'modify_page_title');

function redirect_attachment_pages_to_404() {
if ( is_attachment() ) {
global $wp_query;
$wp_query->set_404();
status_header( 404 );
nocache_headers();
include( get_query_template( '404' ) );
exit;
}
}
add_action( 'template_redirect', 'redirect_attachment_pages_to_404' );

add_action('rest_api_init', function () {
$routes = rest_get_server()->get_routes();
error_log(print_r($routes, true));
Expand Down

0 comments on commit f771c17

Please sign in to comment.