I'm extending the $wpdb
object with properties for my custom tables.
function setup_wpdb()
{
global $wpdb;
// Create properties for custom tables
$wpdb->my_plugin_table1 = $wpdb->prefix.'my_plugin_table1';
$wpdb->my_plugin_table2 = $wpdb->prefix.'my_plugin_table2';
}
Is this a good practice? I guess as long as the properties are prefixed with the plugin name, it should be fine. Defining a constant may work too. What do you prefer and why? Thanks.