apply_filters( 'pre_get_table_charset', string|WP_Error|null $charset, string $table )
- Since
- 4.2.0
Filters the table charset value before the DB is checked.
Description
Returning a non-null value from the filter will effectively short-circuit checking the DB for the charset, returning that value instead.
Parameters
$charsetstring|WP_Error|null- The character set to use, WP_Error object if it couldn't be found. Default null.
$tablestring- The name of the table being checked.
Fired at · 1
wp-includes/class-wpdb.php:3220wpdb::get_table_charset()
Source
<?php * @since 4.2.0 * * @param string|WP_Error|null $charset The character set to use, WP_Error object * if it couldn't be found. Default null. * @param string $table The name of the table being checked. */ $charset = apply_filters( 'pre_get_table_charset', null, $table ); if ( null !== $charset ) { return $charset; } if ( isset( $this->table_charset[ $tablekey ] ) ) { return $this->table_charset[ $tablekey ];History
Introduced in 4.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.