public function __construct() { $this->properties = Core\Dipo_Property_List::get_instance(); $this->textdomain = $this->properties->get('textdomain'); $this->register_podcast_hooks(); $this->include_dependencies(); // setup new tables by simple-term-meta // used for additional meta data in podcast_show taxonomy simple_term_meta_install(); }
/** * Installs the simple term meta plugin and adds default options * * @access public * @return void */ function install() { // Fire the Simple Term Meta installation function on activation simple_term_meta_install(); // Set initial options if not already set $options['control_type'] = $this->control_types[0]['key']; $options['sort_order'] = $this->sort_orders[0]['key']; if (!get_option($this->options_name)) { update_option($this->options_name, $options); } }
(at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * activation - setup table, store db version for future updates */ register_activation_hook(__FILE__, 'simple_term_meta_install'); simple_term_meta_install(); function simple_term_meta_install() { // setup custom table global $wpdb; $table_name = $wpdb->prefix . 'termmeta'; if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") != $table_name) { $sql = "CREATE TABLE " . $table_name . " (\n\t\t meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t term_id bigint(20) unsigned NOT NULL DEFAULT '0',\n\t\t meta_key varchar(255) DEFAULT NULL,\n\t\t meta_value longtext,\n\t\t PRIMARY KEY (meta_id),\n\t\t KEY term_id (term_id),\n\t\t KEY meta_key (meta_key)\n\t\t);"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta($sql); } update_option("simple_term_meta_db_version", '0.9'); } /** * define postmeta table in wpdb */