[wp-trac] [WordPress Trac] #46836: Site Health: Allow any callable for a direct site health test.

WordPress Trac noreply at wordpress.org
Tue Apr 9 00:17:49 UTC 2019


#46836: Site Health: Allow any callable for a direct site health test.
----------------------------+-----------------------
 Reporter:  kraftbj         |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  5.2
Component:  Administration  |    Version:
 Severity:  normal          |   Keywords:  has-patch
  Focuses:                  |
----------------------------+-----------------------
 When trying to extend the site health suite of tests, we should allow any
 callable to return test results for direct tests (async tests still need
 to be a string for the ajax action).

 Being able to do this would be helpful:

 {{{
 add_filter( 'site_status_tests', 'debugger_site_status_tests' );
 function debugger_site_status_tests( $tests ) {
         $tests['direct']['callable'] = array(
                 'label' => 'Example Test',
                 'test' => function(){
                         return array(
                                 'label'       => __( 'Example worked.),
                                 'status'      => 'good',
                                 'badge'       => array(
                                         'label' => __( 'Testing'),
                                         'color' => 'green',
                                 ),
                                 'description' => sprintf(
                                         '<p>%s</p>',
                                         __( "For direct tests, any
 callable works." )
                                 ),
                                 'actions'     => '',
                                 'test'        => 'callable_test',
                         );
                 }
         );

         return $tests;
 }
 }}}

 See #46573

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46836>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list