-
Notifications
You must be signed in to change notification settings - Fork 20
/
wp_ccsve.php
86 lines (73 loc) · 2.37 KB
/
wp_ccsve.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/*
Plugin Name: Custom CSV Export Plugin
Description: A plugin to export WP site content into a CSV file.
Version: .3
Author: Ethan Hinson
Author URI: http://www.bluetentmarketing.com
License: GPL2
*/
/*
Copyright 2013 Ethan Hinson (email : ethan@bluetent.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
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
*/
if(!class_exists('WP_CCSVE'))
{
class WP_CCSVE
{
/**
* Construct the plugin object
*/
public function __construct()
{
// Initialize Settings
require_once(sprintf("%s/settings.php", dirname(__FILE__)));
require_once(sprintf("%s/functions/exporter.php", dirname(__FILE__)));
add_action('init', 'ccsve_export');
$WP_CCSVE_Settings = new WP_CCSVE_Settings();
} // END public function __construct
/**
* Activate the plugin
*/
public static function activate()
{
// Do nothing
} // END public static function activate
/**
* Deactivate the plugin
*/
public static function deactivate()
{
}
}
}
if(class_exists('WP_CCSVE'))
{
// Installation and uninstallation hooks
register_activation_hook(__FILE__, array('WP_CCSVE', 'activate'));
register_deactivation_hook(__FILE__, array('WP_CCSVE', 'deactivate'));
// instantiate the plugin class
$wp_ccsve = new WP_CCSVE();
// Add a link to the settings page onto the plugin page
if(isset($wp_plugin_template))
{
// Add the settings link to the plugins page
function plugin_settings_link($links)
{
$settings_link = '<a href="options-general.php?page=wp_plugin_template">Settings</a>';
array_unshift($links, $settings_link);
return $links;
}
$plugin = plugin_basename(__FILE__);
add_filter("plugin_action_links_$plugin", 'plugin_settings_link');
}
}