WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#9205 closed defect (bug) (fixed)

Filter headers

Reported by: filosofo Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version:
Component: General Keywords: headers wp_headers has-patch
Focuses: Cc:

Description

Problem: Currently there's no good way to control headers via a plugin. For example, under the status quo if someone is logged in the headers are set not to cache, which may not be desirable for a high-traffic community site. Also, others have complained about not being able to remove certain headers.

Solution: Filter the headers printed by the send_headers method of WP.

Patch also adds a wp_get_nocache_headers() function to filter the headers used in nocache_headers().

Attachments (1)

filter_headers.9205.diff (4.0 KB) - added by filosofo 6 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 @westi6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10619]) Allow for the HTTP headers returned by WordPress to be filtered by a plugin. Fixes #9205 props filosofo.

comment:2 @westi6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:3 @westi6 years ago

This causes a php error for the dead_db message ATM as it uses nocache_headers when apply_filters isn't yet available.

comment:4 @westi6 years ago

(In [10626]) Wrap the apply_filters call in a function_exists check as this can be called before it is defined. See #9205.

comment:5 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.