Skip to content

Commit 1c21d5f

Browse files
committed
add auto update
1 parent 7ef2360 commit 1c21d5f

File tree

4 files changed

+490
-10
lines changed

4 files changed

+490
-10
lines changed

inc/customizer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
* @since 3.0.12
1111
*/
1212

13-
use Kirki\Util\Helper;
14-
1513
// Exit if accessed directly.
1614
if ( ! defined( 'ABSPATH' ) ) {
1715
exit;
1816
}
1917

18+
use Kirki\Util\Helper;
19+
20+
21+
2022
// Do not proceed if Kirki does not exist.
2123
if ( ! class_exists( 'Kirki' ) ) {
2224
return;

sweetaddon.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
<?php
2-
32
/**
4-
* The plugin bootstrap file
5-
*
6-
* This file is read by WordPress to generate the plugin information in the plugin
7-
* admin area. This file also includes all of the dependencies used by the plugin,
8-
* registers the activation and deactivation functions, and defines a function
9-
* that starts the plugin.
103
*
114
* @link dev.websweet.xyz
125
* @since 1.2.0
@@ -15,7 +8,7 @@
158
* @wordpress-plugin
169
* Plugin Name: Sweet Addon
1710
* Plugin URI: dev.websweet.xyz
18-
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
11+
* Description: Plugin for websweet.xyz client.
1912
* Version: 1.5.3
2013
* Author: Aditya Kristyanto
2114
* Author URI: dev.websweet.xyz
@@ -53,6 +46,8 @@
5346
);
5447
$incs = array(
5548
'inc/websweet-plugin.php',
49+
'updater/updater.php',
50+
'updater/plugin.php',
5651
'inc/enqueue.php',
5752
'inc/customizer.php',
5853
'inc/function.php',

updater/plugin.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* An example file demonstrating how to add all controls.
4+
*
5+
* @package Kirki
6+
* @category Core
7+
* @author Ari Stathopoulos (@aristath)
8+
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
9+
* @license https://opensource.org/licenses/MIT
10+
* @since 3.0.12
11+
*/
12+
13+
// Exit if accessed directly.
14+
if ( ! defined( 'ABSPATH' ) ) {
15+
exit;
16+
}
17+
18+
add_action( 'init', 'sweetaddon_updater_test_init' );
19+
function sweetaddon_updater_test_init() {
20+
21+
// include_once 'updater.php';
22+
23+
if ( is_admin() ) { // note the use of is_admin() to double check that this is happening in the admin
24+
25+
$config = array(
26+
'slug' => plugin_basename( __FILE__ ),
27+
'proper_folder_name' => 'sweetaddon',
28+
'api_url' => 'https://api.github.com/repos/websweetxyz/sweetaddon',
29+
'raw_url' => 'https://raw.github.com/websweetxyz/sweetaddon/master',
30+
'github_url' => 'https://github.com/websweetxyz/sweetaddon',
31+
'zip_url' => 'https://github.com/websweetxyz/sweetaddon/archive/master.zip',
32+
'sslverify' => true,
33+
'requires' => '1.5.3',
34+
'tested' => '1.5.2',
35+
'readme' => 'README.md',
36+
'access_token' => '',
37+
);
38+
39+
new WP_GitHub_Updater( $config );
40+
41+
}
42+
43+
}

0 commit comments

Comments
 (0)