-
Notifications
You must be signed in to change notification settings - Fork 11
/
sticky-side-buttons.php
58 lines (43 loc) · 1.27 KB
/
sticky-side-buttons.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
50
51
52
53
54
55
56
57
58
<?php
/*
Plugin Name: Sticky Side Buttons
Version: 1.0.9
Plugin URI: https://wordpress.org/plugins/sticky-side-buttons/
Description: Flexible button creator allowing you to stick floating buttons to the side of your site.
Author: Maeve Lander
Author URI: https://profiles.wordpress.org/enigmaweb/
Text Domain: sticky-side-buttons
Domain Path: /languages
License: GPL v3
*/
/**
* Required plugin files
*/
require_once 'ssb-main.php';
require_once 'ssb-ui.php';
/**
* Plugin Activation
*/
function ssb_activate() {
$ssb_options = get_option( 'ssb_settings' );
$default_options = array(
'show_on_frontpage' => 1,
'show_on_posts' => 1,
'show_on_pages' => 1
);
$new_settings = array_merge($ssb_options, $default_options);
update_option( 'ssb_settings', $new_settings );
/** @var $default_options_showoncpt intializing empty array */
$default_options_showoncpt = array();
/** @var $registered_cpts getting registered CPTs */
$registered_cpts = get_post_types(array('_builtin' => false), 'objects');
foreach ($registered_cpts as $registered_cpt){
$default_options_showoncpt[] = $registered_cpt->name;
}
update_option('ssb_showoncpt', $default_options_showoncpt);
}
register_activation_hook( __FILE__, 'ssb_activate' );
/**
* SSB Instance
*/
$ssb = new ssb_main;