Skip to content

mc_db_prefix

github-actions[bot] edited this page Jun 3, 2026 · 4 revisions

Filter the database prefix. Useful when accessing a remote database with a different prefix.

Auto-generated Example

add_filter(
   'mc_db_prefix',
    function(
        string $wpdb->prefix,
        string $table,
        int|string|bool
    ) {
        // Your code here.
        return $wpdb->prefix;
    },
    10,
    3
);

Parameters

  • string $wpdb->prefix Local DB prefix.
  • string $table Database table requested.
  • int|string|bool $site A site ID, the string 'global' for the main site, or false for defaults. Other variable names: $site

Returns

string

Files

apply_filters( 'mc_db_prefix', $wpdb->prefix, $table, $site )

← All Hooks

Clone this wiki locally