diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index db436cbd86..66248981f1 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -1555,6 +1555,14 @@ function dbDelta( $queries = '', $execute = true ) { $queries = explode( ';', $queries ); $queries = array_filter( $queries ); } + + /** + * Filter the dbDelta SQL queries. + * + * @since 3.3.0 + * + * @param array $queries An array of dbDelta SQL queries. + */ $queries = apply_filters( 'dbdelta_queries', $queries ); $cqueries = array(); // Creation Queries @@ -1576,7 +1584,27 @@ function dbDelta( $queries = '', $execute = true ) { // Unrecognized query type } } + + /** + * Filter the dbDelta SQL queries for creating tables and/or databases. + * + * Queries filterable via this hook contain "CREATE TABLE" or "CREATE DATABASE". + * + * @since 3.3.0 + * + * @param array $cqueries An array of dbDelta create SQL queries. + */ $cqueries = apply_filters( 'dbdelta_create_queries', $cqueries ); + + /** + * Filter the dbDelta SQL queries for inserting or updating. + * + * Queries filterable via this hook contain "INSERT INTO" or "UPDATE". + * + * @since 3.3.0 + * + * @param array $iqueries An array of dbDelta insert or update SQL queries. + */ $iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries ); $global_tables = $wpdb->tables( 'global' );