pre_get_table_charset WordPress Filter Hook

The pre_get_table_charset hook is triggered before retrieving the table charset. It can be used to override the default charset for the database table.

apply_filters( 'pre_get_table_charset', string|WP_Error|null $charset, string $table ) #

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.


Top ↑

Parameters

$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.


Top ↑

Source

File: wp-includes/wp-db.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.