Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
different dataset for table
<?php
$wpdb->add_database( array(
'host' => 'global.db.example.com',
'user' => 'globaluser',
'password' => 'globalpassword',
'name' => 'globaldb',
) );
$wpdb->add_database( array(
'host' => '192.168.1.5',
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => 'mycustomdatabase',
'write' => 1,
'read' => 1,
'dataset' => 'customdataset',
'timeout' => 0.5,
) );
$wpdb->add_table( 'customdataset', 'wp_my_custom_table' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment