• Hello,

    I find myself in need of a CUSTOMER_OPTIONS_TABLE define and may need any of the tables to be CUSTOM_xxx_TABLE options. The reason is to display the site using two different themes. For example we use one options table for a ‘beta’ site and another for ‘production’. This way those who are asked to review the beta theme are looking at all the ‘real’ stuff and can make a better decision on what should change etc.

    Since one exists for users and usermeta, why not the other core tables?

    Possible to implement something like this? I have made the mod myself and the patch follows:

    *** wp-db.php	2014-04-19 10:26:33.000000000 -0500
    --- /usr/share/wordpress/wp-includes/wp-db.php	2014-04-19 09:34:17.000000000 -0500
    ***************
    *** 951,959 ****
    
      			if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) )
      				$tables['usermeta'] = CUSTOM_USER_META_TABLE;
    -
    - 			if ( isset( $tables['options'] ) && defined( 'CUSTOM_OPTIONS_TABLE' ) )
    - 				$tables['options'] = CUSTOM_OPTIONS_TABLE;
      		}
    
      		return $tables;
    --- 951,956 ----
Viewing 1 replies (of 1 total)
  • Just add new line for options database:

    if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) )
    				$tables['usermeta'] = CUSTOM_USER_META_TABLE;
    			if ( isset( $tables['options'] ) )
    				$tables['options'] = $blog_prefix . 'options2';

    where options2 represents the new database (ex: wp_options2)

Viewing 1 replies (of 1 total)

The topic ‘CUSTOM_xxx_TABLE options’ is closed to new replies.