-
Notifications
You must be signed in to change notification settings - Fork 7
/
shapely-companion.php
92 lines (76 loc) · 2.53 KB
/
shapely-companion.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/*
* Plugin Name: Shapely Companion
* Plugin URI: https://colorlib.com/wp/themes/shapely/
* Description: Shapely Companion is a companion plugin for Shapely theme.
* Version: 1.2.7
* Author: Colorlib
* Author URI: https://colorlib.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: shapely-companion
* Domain Path: /languages
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'SHAPELY_COMPANION', '1.2.7' );
/**
* Load the Dashboard Widget
*/
require_once plugin_dir_path( __FILE__ ) . 'inc/epsilon-dashboard/class-epsilon-dashboard.php';
/**
* The helper method to run the class
*
* @return Epsilon_Dashboard
*/
function shapely_companion_dashboard_widget() {
$epsilon_dashboard_args = array(
'widget_title' => esc_html__( 'From our blog', 'shapely-companion' ),
'feed_url' => array( 'https://colorlib.com/wp/feed/' ),
);
return Epsilon_Dashboard::instance( $epsilon_dashboard_args );
}
shapely_companion_dashboard_widget();
$current_theme = wp_get_theme();
$current_parent = $current_theme->parent();
if ( 'Shapely' == $current_theme->get( 'Name' ) || ( $current_parent && 'Shapely' == $current_parent->get( 'Name' ) ) ) {
/**
* Load the Widgets
*/
require_once plugin_dir_path( __FILE__ ) . 'inc/shapely-widgets.php';
/**
* Load Enqueues
*/
require_once plugin_dir_path( __FILE__ ) . '/inc/shapely-enqueues.php';
/**
* Load Helper
*/
require_once plugin_dir_path( __FILE__ ) . '/inc/shapely-helper.php';
/**
* Load Import Demo Content Functionality
*/
require_once plugin_dir_path( __FILE__ ) . '/inc/shapely-demo-content.php';
/**
* Load Nav Menu Functionality
*/
require_once plugin_dir_path( __FILE__ ) . '/inc/shapely-navmenu.php';
/**
* Load Metabox for Portfolio
*/
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'custom-content-types' ) ) {
$jetpack_portfolio = get_option( 'jetpack_portfolio' );
if ( $jetpack_portfolio ) {
require_once plugin_dir_path( __FILE__ ) . '/inc/shapely-metabox.php';
}
}
} else {
add_action( 'admin_notices', 'shapely_companion_admin_notice', 99 );
function shapely_companion_admin_notice() {
?>
<div class="notice-warning notice">
<p><?php printf( wp_kses_post( __( 'In order to use the <strong>Shapely Companion</strong> plugin you have to also install the %1$sShapely Theme%2$s', 'shapely-companion' ) ), '<a href="https://wordpress.org/themes/shapely/" target="_blank">', '</a>' ); ?></p>
</div>
<?php
}
}