dbdelta_insert_queries

Filters the dbDelta SQL queries for inserting or updating.

Description

apply_filters( 'dbdelta_insert_queries', (array) $iqueries ); 

Queries filterable via this hook contain INSERT INTO or UPDATE..

Parameters (1)

0. $iqueries (array)
An array of dbDelta insert or update SQL queries.

Usage

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

Defined (1)

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

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