Repository navigation
Expand file tree
/
Copy pathgallery-box.php
More file actions
120 lines (105 loc) · 3.7 KB
/
Copy pathgallery-box.php
File metadata and controls
120 lines (105 loc) · 3.7 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/*
* @link http://themeforest.digitalkroy.com/gallery-box/
* @since 1.0.0
* @package Gallery box wordpress plugin
*
* @wordpress-plugin
* Plugin Name: Gallery Box
* Plugin URI: http://themeforest.digitalkroy.com/gallery-box/
* Description: You can create awesome image,audio, video and i-frame gellery with lots of effects By this plugin.
* Version: 1.0.0
* Author: Noor alam
* Author URI: http://codecanyon.net/user/noor-alam
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: gbox
* Domain Path: /languages
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
*
* admin specific file includes
*/
if ( is_admin() ) {
// We are in admin mode
require_once( plugin_dir_path(__FILE__).'/admin/gallerybox-post-type.php' );
require_once( plugin_dir_path(__FILE__).'/admin/gallerybox-options.php' );
require_once( plugin_dir_path(__FILE__).'/admin/gallerybox-meta.php' );
require_once( plugin_dir_path(__FILE__).'/admin/add-button-tinymce.php' );
require_once( plugin_dir_path(__FILE__).'/admin/src/CMB-metabox/init.php' );
}
/**
* public specific file includes
*
*/
require_once( plugin_dir_path(__FILE__). '/includes/gallerybox-shortcode.php');
require_once( plugin_dir_path(__FILE__). '/includes/gallerybox-options-set.php');
/**
* Load the plugin all style and script.
*
* @since 1.0.0
*/
if ( ! function_exists( 'gbox_style_scripts' ) ) :
function gbox_style_scripts() {
//style enqueue
wp_enqueue_style( 'galleryBox-effects', plugins_url( '/assets/css/effects.css', __FILE__ ), array(), '1.0', 'all');
wp_enqueue_style( 'galleryBox-colabthi-webfont', plugins_url( '/assets/fonts/colabthi-webfont.css', __FILE__ ), array(), '1.0', 'all');
wp_enqueue_style( 'galleryBox-style', plugins_url( '/assets/css/galleryBox-style.css', __FILE__ ), array(), '1.0', 'all');
//scripts enqueue
wp_enqueue_script('jquery');
wp_enqueue_script( 'galleryBox-jquery.poptrox', plugins_url( '/assets/js/jquery.poptrox.min.js', __FILE__ ), array( 'jquery' ), '2.5.1', true);
}
add_action( 'wp_enqueue_scripts', 'gbox_style_scripts' );
endif;
/**
* Admin style enqueue.
*
* @since 1.0.0
*/
if ( ! function_exists( 'gbox_admin_scripts' ) ) :
function gbox_admin_scripts() {
wp_enqueue_style('galleryBox_admin', plugins_url('/assets/css/galleryBox-admin.css', __FILE__) );
}
add_action( 'admin_enqueue_scripts', 'gbox_admin_scripts' );
endif;
/**
* Gallery Box admin role.
*
*/
if ( ! function_exists( 'gallerybox_activation_setup' ) ) :
function gallerybox_activation_setup() {
// Trigger our function that registers the custom post type
gallerybox_post_type();
// Clear the permalinks after the post type has been registered
flush_rewrite_rules();
// Add new administrator role
gallerybox_admin_role();
}
register_activation_hook( __FILE__, 'gallerybox_activation_setup' );
endif;
if ( ! function_exists( 'gallerybox_deactivation_setup' ) ) :
function gallerybox_deactivation_setup() {
// Clear the permalinks to remove our post type's rules
flush_rewrite_rules();
// gets the administrator role remove
gallerybox_admin_role_remove();
}
register_deactivation_hook( __FILE__, 'gallerybox_deactivation_setup' );
endif;
/**
* Load plugin textdomain.
*
* @since 1.0.0
*/
if ( ! function_exists( 'gbox_textdomain' ) ) :
function gbox_textdomain() {
load_plugin_textdomain( 'gbox', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
}
add_action( 'plugins_loaded', 'gbox_textdomain' );
endif;
//Add custom image size
add_image_size( 'gBox-medium', 450, 450, true );
add_image_size( 'gBox-large', 600, 600, true );