pre_get_table_charset filter-hookWP 4.2.0

Filters the table charset value before the DB is checked.

Returning a non-null value from the filter will effectively short-circuit checking the DB for the charset, returning that value instead.

Usage

add_filter( 'pre_get_table_charset', 'wp_kama_pre_get_table_charset_filter', 10, 2 );

/**
 * Function for `pre_get_table_charset` filter-hook.
 * 
 * @param string|WP_Error|null $charset The character set to use, WP_Error object if it couldn't be found.
 * @param string               $table   The name of the table being checked.
 *
 * @return string|WP_Error|null
 */
function wp_kama_pre_get_table_charset_filter( $charset, $table ){

	// filter...
	return $charset;
}
$charset(string|WP_Error|null)
The character set to use, WP_Error object if it couldn't be found.
Default: null
$table(string)
The name of the table being checked.

Changelog

Since 4.2.0 Introduced.

Where the hook is called

wpdb::get_table_charset()
pre_get_table_charset
wp-includes/class-wpdb.php 2920
$charset = apply_filters( 'pre_get_table_charset', null, $table );

Where the hook is used in WordPress

Usage not found.