Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: tables_to_repair

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

Line Code
32      $okay = true;
33      $problems = array();
34
35      $tables = $wpdb->tables();
36
37      // Sitecategories may not exist if global terms are disabled.
38      if ( is_multisite() && ! $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->sitecategories'" ) )
39           unset( $tables['sitecategories'] );
40
41      $tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) ); // Return tables with table prefixes.
42
43      // Loop over the tables, checking and repairing as needed.
44      foreach ( $tables as $table ) {
45           $check = $wpdb->get_row( "CHECK TABLE $table" );
46
47           echo '<p>';
48           if ( 'OK' == $check->Msg_text ) {
49                /* translators: %s: table name */
50                printf( __( 'The %s table is okay.' ), "<code>$table</code>" );