-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkbso-theme.php
66 lines (50 loc) · 1.64 KB
/
kbso-theme.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
59
60
61
62
63
64
65
66
<?php
/**
* Plugin Name: Kebo Social - Post Sharing - Addon Theme
* Plugin URI: http://domain.com/
* Description: A custom Theme for Kebo Social Share Buttons.
* Version: 0.1.0
* Author: Author
* Author URI: http://domain.com/
* License: GPLv2+
*/
// Block direct access
if ( ! defined( 'ABSPATH' ) ) {
die( 'Sorry, no direct access.' );
}
// Useful global constants
define( 'PREFIX_VERSION', '0.1.0' );
define( 'PREFIX_URL', plugin_dir_url(__FILE__) );
define( 'PREFIX_PATH', plugin_dir_path(__FILE__) );
/*
* Load Plugin
*/
function prefix_plugin_setup() {
/*
* Add the Custom Theme to the Post Sharing Theme list.
*/
function prefix_add_custom_post_sharing_theme( $themes ) {
$custom_theme = array(
'awesome' => array(
'value' => 'awesome',
'label' => __( 'Awesome' )
),
);
$all_themes = array_merge( $themes, $custom_theme );
return $all_themes;
}
add_filter( 'kbso_post_sharing_themes', 'prefix_add_custom_post_sharing_theme' );
/*
* If using our custom theme, edit path to custom view files.
*
* Only need this if you want to change the HTML structure/output.
*/
function prefix_change_post_sharing_view_dir( $view, $theme ) {
if ( 'awesome' == $theme ) {
$view = PREFIX_PATH . 'views';
}
return $view;
}
add_filter( 'kbso_post_sharing_view_dir', 'prefix_change_post_sharing_view_dir', 10, 2 );
}
add_action( 'plugins_loaded', 'prefix_plugin_setup', 15 );