This repository was archived by the owner on Sep 26, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtt-meta.php
executable file
·72 lines (64 loc) · 1.99 KB
/
tt-meta.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* @wordpress-plugin
* Plugin Name: Term Taxonomy Meta
* Description: Add metadata to term taxonomy relationships
* Version: 1.0.0
* Author: Vince Kruger
* Author URI: https://github.com/vincekruger/wp-term-taxonomy-meta
* License: MIT
* License URI: http://opensource.org/licenses/MIT
* Text Domain: tt-meta
* Domain Path: /languages
*/
// If this file is called directly, abort.
defined('WPINC') or die();
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-tt-meta-activator.php
*/
function activate_tt_meta()
{
require_once plugin_dir_path(__FILE__) . 'includes/class-tt-meta-activator.php';
TT_Meta_Activator::activate();
}
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-tt-meta-deactivator.php
*/
function deactivate_tt_meta()
{
require_once plugin_dir_path(__FILE__) . 'includes/class-tt-meta-deactivator.php';
TT_Meta_Deactivator::deactivate();
}
/**
* Add table names to the wpdb class for availability
* inside your wp installation
*/
function term_taxonomymeta_wpdbfix()
{
global $wpdb;
$wpdb->term_taxonomymeta = $wpdb->prefix . 'term_taxonomymeta';
$wpdb->tables[] = 'term_taxonomymeta';
}
register_activation_hook(__FILE__, 'activate_tt_meta');
register_deactivation_hook(__FILE__, 'deactivate_tt_meta');
add_action('init', 'term_taxonomymeta_wpdbfix', 0);
add_action('switch_blog', 'term_taxonomymeta_wpdbfix', 0);
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path(__FILE__) . 'includes/class-tt-meta.php';
/**
* Begins execution of the plugin.
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*/
function run_tt_meta()
{
$plugin = new TT_Meta();
$plugin->run();
}
run_tt_meta();