-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (28 loc) · 1.07 KB
/
Copy pathindex.php
File metadata and controls
36 lines (28 loc) · 1.07 KB
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
<?php
/*
Plugin Name: Sample Plugin Name
Plugin URI: http://visztpeter.me
Description: Your Plugin Description
Author: Your Name
Version: 1.0
Update URI: simple-wp-plugin-update
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
//Run your plugin as usual
if( ! class_exists( 'SampleExtension' ) ) {
class SampleExtension {
public function __construct() {
//Check for updates
require_once( plugin_dir_path( __FILE__ ) . 'class-update.php' );
$update = new Simple_Update_Check('simple-wp-plugin-update'); //Add your plugin slug here(same as the folder name and same as the Update URI in the plugin header)
//Uncomment this for testing, so it will check for plugin updates on every page load
/*
add_action( 'init', function(){
delete_transient( 'update_plugins' );
delete_site_transient( 'update_plugins' );
});
*/
}
}
new SampleExtension();
}