Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: site_status_test_result

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
111                                *
112                                *         @param string $label The test label, for example `Performance`.
113                                *         @param string $color Default `blue`. A string representing a color to use for the label.
114                                *     }
115                                *     @param string $description A more descriptive explanation of what the test looks for, and why it is important for the end user.
116                                *     @param string $actions     An action to direct the user to where they can resolve the issue, if one exists.
117                                *     @param string $test        The name of the test being ran, used as a reference point.
118                                * }
119                                */
120                               $health_check_js_variables['site_status']['direct'][] = apply_filters( 'site_status_test_result', call_user_func( array( $this, $test_function ) ) );
121                               continue;
122                          }
123                     }
124
125                     if ( is_callable( $test['test'] ) ) {
126                          /** This filter is documented in wp-admin/includes/class-wp-site-health.php */
127                          $health_check_js_variables['site_status']['direct'][] = apply_filters( 'site_status_test_result', call_user_func( $test['test'] ) );
128                     }
129                }
130
131                foreach ( $tests['async'] as $test ) {
132                     if ( is_string( $test['test'] ) ) {
133                          $health_check_js_variables['site_status']['async'][] = array(
134                               'test'      => $test['test'],
135                               'completed' => false,
136                          );