WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
1827 | ); |
1828 |
|
1829 | $cookies = wp_unslash( $_COOKIE ); |
1830 | $timeout = 10; |
1831 | $headers = array( |
1832 | 'Cache-Control' => 'no-cache', |
1833 | 'X-WP-Nonce' => wp_create_nonce( 'wp_rest' ), |
1834 | ); |
1835 | /** This filter is documented in wp-includes/class-wp-http-streams.php */ |
1836 | $sslverify = apply_filters( 'https_local_ssl_verify', false ); |
1837 |
|
1838 | // Include Basic auth in loopback requests. |
1839 | if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { |
1840 | $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); |
1841 | } |
1842 |
|
1843 | $url = rest_url( 'wp/v2/types/post' ); |
1844 |
|
1845 | // The context for this is editing with the new block editor. |
Line | Code |
2161 | * @return object The test results. |
2162 | */ |
2163 | function can_perform_loopback() { |
2164 | $cookies = wp_unslash( $_COOKIE ); |
2165 | $timeout = 10; |
2166 | $headers = array( |
2167 | 'Cache-Control' => 'no-cache', |
2168 | ); |
2169 | /** This filter is documented in wp-includes/class-wp-http-streams.php */ |
2170 | $sslverify = apply_filters( 'https_local_ssl_verify', false ); |
2171 |
|
2172 | // Include Basic auth in loopback requests. |
2173 | if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { |
2174 | $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); |
2175 | } |
2176 |
|
2177 | $url = admin_url(); |
2178 |
|
2179 | $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) ); |