-
Notifications
You must be signed in to change notification settings - Fork 3
/
example-plugin.php
49 lines (44 loc) · 1.32 KB
/
example-plugin.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
<?php
/**
* Plugin Name: Example Plugin
* Plugin URI: PLUGIN SITE HERE
* Description: PLUGIN DESCRIPTION HERE
* Author: YOUR NAME HERE
* Author URI: YOUR SITE HERE
* Text Domain: example-plugin
* Domain Path: /languages
* Version: 1.0.0
*/
// If this file is called directly, abort.
defined( 'ABSPATH' ) || exit;
/**
* Current plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'EXAMPLE_PLUGIN_VERSION', '1.0.0' );
if ( ! defined( 'EXAMPLE_PLUGIN_API_URL' ) ) {
/**
* The API URL to check for updates.
* This should be unique to this plugin and point to a remote server
* running the Lemon Squeezy plugin.
*/
define( 'EXAMPLE_PLUGIN_API_URL', 'http://example.com/wp-json/lsq/v1' );
}
/**
* Import the plugin updater class.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-plugin-updater.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-settings-page.php';
/**
* Instanciate the updater class.
*
* Everything within the updater is registered via hooks,
* so it's safe to instanciate this at any time.
*/
new ExamplePluginUpdater(
plugin_basename( __FILE__ ),
plugin_basename( __DIR__ ),
EXAMPLE_PLUGIN_VERSION,
EXAMPLE_PLUGIN_API_URL
);