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 |
---|---|
2030 | ); |
2031 |
|
2032 | $cookies = wp_unslash( $_COOKIE ); |
2033 | $timeout = 10; |
2034 | $headers = array( |
2035 | 'Cache-Control' => 'no-cache', |
2036 | 'X-WP-Nonce' => wp_create_nonce( 'wp_rest' ), |
2037 | ); |
2038 | /** This filter is documented in wp-includes/class-wp-http-streams.php */ |
2039 | $sslverify = apply_filters( 'https_local_ssl_verify', false ); |
2040 |
|
2041 | // Include Basic auth in loopback requests. |
2042 | if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { |
2043 | $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); |
2044 | } |
2045 |
|
2046 | $url = rest_url( 'wp/v2/types/post' ); |
2047 |
|
2048 | // The context for this is editing with the new block editor. |
Line | Code |
2659 | */ |
2660 | public function can_perform_loopback() { |
2661 | $body = array( 'site-health' => 'loopback-test' ); |
2662 | $cookies = wp_unslash( $_COOKIE ); |
2663 | $timeout = 10; |
2664 | $headers = array( |
2665 | 'Cache-Control' => 'no-cache', |
2666 | ); |
2667 | /** This filter is documented in wp-includes/class-wp-http-streams.php */ |
2668 | $sslverify = apply_filters( 'https_local_ssl_verify', false ); |
2669 |
|
2670 | // Include Basic auth in loopback requests. |
2671 | if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { |
2672 | $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); |
2673 | } |
2674 |
|
2675 | $url = site_url( 'wp-cron.php' ); |
2676 |
|
2677 | /* |