dbdelta_create_queries

Filters the dbDelta SQL queries for creating tables and/or databases.

Description

apply_filters( 'dbdelta_create_queries', (array) $cqueries ); 

Queries filterable via this hook contain CREATE TABLE or CREATE DATABASE..

Parameters (1)

0. $cqueries (array)
An array of dbDelta create SQL queries.

Usage

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

Defined (1)

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

/wp-admin/includes/upgrade.php  
  1. $cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );