Algo así?
Código PHP:
Ver original<?php
/*
Plugin Name:
Plugin URI:
Description:
Version:
Author:
Author URI:
*/
register_activation_hook(__FILE__, 'install_plugin');
add_action('admin_init', 'hacer_todo_lo_demas');
function install_plugin()
{
global $wpdb;
$sql = "SHOW TABLES LIKE $wpdb->prefix". TABLA;
if ($wpdb->get_var( $sql) != $wpdb->prefix. TABLA) {
$this->_do_real_install();
}
}
function _do_real_install()
{
global $wpdb;
$install_sql = "CREATE TABLE `" . $wpdb->prefix . TABLA ."` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`name` VARCHAR(255) NOT NULL,
`blabla` VARCHAR(255) NOT NULL,
`masbla` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;";
$wpdb->query( $install_sql );
}