forked from palasthotel/grid-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrid-wordpress-update.inc
More file actions
executable file
·49 lines (39 loc) · 1.18 KB
/
grid-wordpress-update.inc
File metadata and controls
executable file
·49 lines (39 loc) · 1.18 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
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @author Palasthotel <rezeption@palasthotel.de>
* @copyright Copyright (c) 2014, Palasthotel
* @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2
* @package Palasthotel\Grid-Wordpress
*/
class grid_wordpress_update extends base_update
{
public $schemakey = "_wordpress";
public function update_1()
{
db_query("insert into {grid_schema} (propkey) values ('schema_version".$this->schemakey."') ON DUPLICATE KEY UPDATE propkey = 'schema_version".$this->schemakey."';");
add_action('admin_notices', array($this, 'notice_1'));
}
public function notice_1(){
/**
* install button for plugin
*/
$action = 'install-plugin';
$slug = 'grid-social-boxes';
$url = wp_nonce_url(
add_query_arg(
array(
'action' => $action,
'plugin' => $slug
),
admin_url( 'update.php' )
),
$action.'_'.$slug
);
$button = "<a href='$url' class='install-now button'>Install</a>";
echo '<div class="update-nag">
<p>Grid Facebook Box and Twitter Box were moved to a separate plugin <a href="https://wordpress.org/plugins/grid-social-boxes">Grid Social Boxes</a>.</p>
<p>'.$button.'</p>
</div>';
}
}
?>