Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 48 lines (35 sloc) 1.352 kB
a89f02d @tombenner Initial commit
authored
1 <?php
2 /*
3 Plugin Name: WP MVC
37a8154 @tombenner Changing references to the plugin's directory from 'wp_mvc' to 'wp-mvc'
authored
4 Plugin URI: http://wordpress.org/extend/plugins/wp-mvc/
a89f02d @tombenner Initial commit
authored
5 Description: Sets up an MVC framework inside of WordPress.
6 Author: Tom Benner
e4589af @tombenner Updating to 1.2
authored
7 Version: 1.2
a89f02d @tombenner Initial commit
authored
8 Author URI:
9 */
10
11 if (!defined('MVC_PLUGIN_PATH')) {
12 define('MVC_PLUGIN_PATH', dirname(__FILE__).'/');
13 }
14
726fbf4 @tombenner Making distinct public and admin loaders to improve code clarity and …
authored
15 if (is_admin()) {
16
17 // Load admin functionality
18
19 require_once MVC_PLUGIN_PATH.'core/loaders/mvc_admin_loader.php';
20 $loader = new MvcAdminLoader();
21
22 add_action('admin_init', array($loader, 'admin_init'));
23 add_action('admin_menu', array($loader, 'add_menu_pages'));
bd64a2a @tombenner Adding support for making settings pages using MvcSettings
authored
24 add_action('admin_menu', array($loader, 'add_settings_pages'));
726fbf4 @tombenner Making distinct public and admin loaders to improve code clarity and …
authored
25 add_action('plugins_loaded', array($loader, 'add_admin_ajax_routes'));
26
27 } else {
28
29 // Load public functionality
30
31 require_once MVC_PLUGIN_PATH.'core/loaders/mvc_public_loader.php';
32 $loader = new MvcPublicLoader();
33
34 // Filters for public URLs
35 add_filter('wp_loaded', array($loader, 'flush_rewrite_rules'));
36 add_filter('rewrite_rules_array', array($loader, 'add_rewrite_rules'));
37 add_filter('query_vars', array($loader, 'add_query_vars'));
38 add_filter('template_redirect', array($loader, 'template_redirect'));
a89f02d @tombenner Initial commit
authored
39
726fbf4 @tombenner Making distinct public and admin loaders to improve code clarity and …
authored
40 }
a89f02d @tombenner Initial commit
authored
41
726fbf4 @tombenner Making distinct public and admin loaders to improve code clarity and …
authored
42 // Load global functionality
a89f02d @tombenner Initial commit
authored
43
726fbf4 @tombenner Making distinct public and admin loaders to improve code clarity and …
authored
44 add_action('init', array($loader, 'init'));
45 add_action('widgets_init', array($loader, 'register_widgets'));
262476a @tombenner Adding support for automatically created and updated posts (of a cust…
authored
46 add_filter('post_type_link', array($loader, 'filter_post_link'), 10, 2);
a89f02d @tombenner Initial commit
authored
47
48 ?>
Something went wrong with that request. Please try again.