pre_get_col_charset

Filters the column charset value before the DB is checked.

Description

apply_filters( 'pre_get_col_charset', (null) $null, (string) $table, (string) $column ); 

Passing a non-null value to the filter will short-circuit checking the DB for the charset, returning that value instead.

Parameters (3)

0. $null (null) => null
The character set to use. Default null.
1. $table (string)
The name of the table being checked.
2. $column (string)
The name of the column being checked.

Usage

To run the hook, copy the example below.
  1. $null = apply_filters( 'pre_get_col_charset', $null, $table, $column ); 
  2.  
  3. if ( !empty( $null ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the pre_get_col_charset callback 
  2. function filter_pre_get_col_charset( $null, $table, $column ) { 
  3. // make filter magic happen here... 
  4. return $null
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'pre_get_col_charset', 'filter_pre_get_col_charset', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'pre_get_col_charset', 'filter_pre_get_col_charset', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/wp-db.php  
  1. $charset = apply_filters( 'pre_get_col_charset', null, $table, $column );