Multisite activation plugin fails on additional blogs (missing column)
-
Thank you for the plugin (and I’m sorry to bother you again ?? I’m not really a developers stalker).
The plugin activation function is not “network compliant”.
The SQL is done only for first blog. In other blogs, the additional column “term_order” is not created during the activation and the plugin simply doesn’t work.The function:
function customtaxorder_activate() { global $wpdb; $init_query = $wpdb->query("SHOW COLUMNS FROM $wpdb->terms LIKE 'term_order'"); if ($init_query == 0) { $wpdb->query("ALTER TABLE $wpdb->terms ADD <code>term_order</code> INT( 4 ) NULL DEFAULT '0'"); } }
can be something like:
function _customtaxorder_activate() { global $wpdb; $init_query = $wpdb->query("SHOW COLUMNS FROM $wpdb->terms LIKE 'term_order'"); if ($init_query == 0) { $wpdb->query("ALTER TABLE $wpdb->terms ADD <code>term_order</code> INT( 4 ) NULL DEFAULT '0'"); } } function customtaxorder_activate($networkwide) { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { if ($networkwide) { $curr_blog = $wpdb->blogid; $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); _customtaxorder_activate(); } switch_to_blog($curr_blog); } } else { _customtaxorder_activate(); } }
Ciao;
Matteohttps://www.ads-software.com/plugins/custom-taxonomy-order-ne/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Multisite activation plugin fails on additional blogs (missing column)’ is closed to new replies.