wpdatatables_filter_pdo_connection_dsn

Contents

Description

This filter is used to modify the Data Source Name (DSN) used by the Separate DataBase connection, allowing you to customize the database connection string before it is passed to the PDO instance.

Usage

add_filter( 'wpdatatables_filter_pdo_connection_dsn', 'modify_pdo_connection_dsn', 10, 3 );

Parameters

  • $dsn string
    The original DSN string used for the database connection.
  • $vendor string
    The database vendor.
  • $_POST array
    An array of data submitted via POST.

Examples

// Callback function for the wpdatatables_filter_pdo_connection_dsn filter hook
function modify_pdo_connection_dsn($dsn, $vendor, $_POST) {
    // Your code
    return $dsn;
}

add_filter( 'wpdatatables_filter_pdo_connection_dsn', 'modify_pdo_connection_dsn', 10, 3 );