|
1 | 1 | <?php |
| 2 | +/* |
| 3 | +Plugin Name: Template Controller |
| 4 | +Plugin URI: https://github.com/creativecoder/wp-template-controller |
| 5 | +Description: Separate data generation from presentation in your WordPress templates |
| 6 | +Version: 0.1 |
| 7 | +Author: Grant Kinney |
| 8 | +Author URI: https://github.com/creativecoder |
| 9 | +License: GPL2 |
| 10 | +License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 11 | +Text Domain: 'template-controller' |
| 12 | +*/ |
| 13 | + |
2 | 14 | if ( ! class_exists( 'Template_Controller' ) ) { |
3 | 15 | /** |
4 | 16 | * Parent class for passing data into template files |
@@ -151,3 +163,25 @@ function get_tpl_data( $name ) { |
151 | 163 | function tpl_data( $name ) { |
152 | 164 | echo esc_html(Template_Controller::get_instance()->get($name)); |
153 | 165 | } |
| 166 | + |
| 167 | +add_action( 'admin_init', function () { |
| 168 | + include_once( 'WordPress-GitHub-Plugin-Updater/updater.php' ); |
| 169 | + |
| 170 | + define( 'WP_GITHUB_FORCE_UPDATE', true ); |
| 171 | + |
| 172 | + $config = array( |
| 173 | + 'slug' => plugin_basename(__FILE__), // this is the slug of your plugin |
| 174 | + 'proper_folder_name' => 'wp-template-controller', // this is the name of the folder your plugin lives in |
| 175 | + 'api_url' => 'https://api.github.com/repos/creativecoder/wp-template-controller', // the GitHub API url of your GitHub repo |
| 176 | + 'raw_url' => 'https://raw.github.com/creativecoder/wp-template-controller/master', // the GitHub raw url of your GitHub repo |
| 177 | + 'github_url' => 'https://github.com/creativecoder/wp-template-controller', // the GitHub url of your GitHub repo |
| 178 | + 'zip_url' => 'https://github.com/creativecoder/wp-template-controller/zipball/master', // the zip url of the GitHub repo |
| 179 | + 'sslverify' => true, // whether WP should check the validity of the SSL cert when getting an update, see https://github.com/jkudish/WordPress-GitHub-Plugin-Updater/issues/2 and https://github.com/jkudish/WordPress-GitHub-Plugin-Updater/issues/4 for details |
| 180 | + 'requires' => '3.0', // which version of WordPress does your plugin require? |
| 181 | + 'tested' => '4.4', // which version of WordPress is your plugin tested up to? |
| 182 | + 'readme' => 'README.md', // which file to use as the readme for the version number |
| 183 | + 'access_token' => '', // Access private repositories by authorizing under Appearance > GitHub Updates when this example plugin is installed |
| 184 | + ); |
| 185 | + |
| 186 | + new WP_GitHub_Updater( $config ); |
| 187 | +}); |
0 commit comments