http_response filter makes it possible to manipulate the response array returned by a
It is evaluated in the private
WP_Http::_dispatch_request() method, which is called by
WP_Http::request() in wp-includes/class-http.php file.
http_response filter accepts three arguments:
$response The response array
$args An array of arguments (see
wp_remote_request() in wp-includes/http.php)
$url The URL to request
Let’s say you’re pinging some external site and displaying the body of the requested site somewhere but you only want to display the content if it is actually valid — say, based on whether the status code is 200, 301, or 302. For any other status code, you want to override the body of the http response with some general template.
View the code example on Gist
the_weekday_date filter makes it possible to change the displayed day of the week a post was published, when the function of the same name —
the_weekday_date() — is used inside the Loop.
It is located in wp-includes/general-template.php and
the_weekday_date() only outputs the day if the current post’s weekday is different from the previous one output (why this would be needed, I have no idea).
The filter accepts three arguments:
$the_weekday_date The day of the week
$before Text or markup before
$after Text or markup after
The original value of
$the_weekday_date is determined using a chain of functions to snag the localized day of the week:
get_weekday() method of the
Let’s say you wanted to convert the day ‘Saturday’ into pirate-speak, something like ‘SatARRRday’ and were using
the_weekday_date() to output it in the Loop.