PluginProbe
Gallery Box / 1.5.1
Gallery Box v1.5.1
trunk 1.3.1 1.3.3 1.4.0 1.4.1 1.4.2 1.5.1 1.7.35
gallery-box / gallery-box.php

gallery-box.php in Gallery Box 1.5.1, at gallery-box.php

135 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * @link http://wpthemespace.com
4 * @since 1.1.0
5 * @package Gallery box wordpress plugin
6 *
7 * @wordpress-plugin
8 * Plugin Name: Gallery Box
9 * Plugin URI: http://wpthemespace.com
10 * Description: You can create awesome image, portfolio, audio, video and i-frame gellery with lots of effects By this plugin.
11 * Version: 1.5.1
12 * Author: Noor alam
13 * Author URI: http://wpthemespace.com
14 * License: GPL-2.0+
15 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
16 * Text Domain: gbox
17 * Domain Path: /languages
18 */
19
20 if ( ! defined( 'ABSPATH' ) ) {
21 exit; // Exit if accessed directly.
22 }
23
24 /**
25 *
26 * admin specific file includes
27 */
28 if ( is_admin() ) {
29 // We are in admin mode
30 require_once( plugin_dir_path(__FILE__).'/admin/gallerybox-post-type.php' );
31 require_once( plugin_dir_path(__FILE__).'/admin/gallerybox-options.php' );
32 require_once( plugin_dir_path(__FILE__).'/admin/gallerybox-meta.php' );
33 require_once( plugin_dir_path(__FILE__).'/admin/add-button-tinymce.php' );
34 require_once( plugin_dir_path(__FILE__).'/admin/src/cmb2/init.php' );
35 require_once( plugin_dir_path(__FILE__).'/admin/src/cmb2-slider/slider-field.php' );
36 require_once( plugin_dir_path(__FILE__).'/admin/src/cmb2-select2/select2.php' );
37 require_once( plugin_dir_path(__FILE__).'/admin/src/cmb2/cmb2-conditionals.php' );
38 require_once( plugin_dir_path(__FILE__).'/admin/gallerybox-visual-composer.php' );
39
40 }
41
42
43 /**
44 * public specific file includes
45 *
46 */
47 require_once( plugin_dir_path(__FILE__). '/includes/gallerybox-shortcode.php');
48 require_once( plugin_dir_path(__FILE__). '/includes/gallerybox-options-set.php');
49
50
51 /**
52 * Load the plugin all style and script.
53 *
54 * @since 1.0.0
55 */
56
57 if ( ! function_exists( 'gbox_style_scripts' ) ) :
58 function gbox_style_scripts() {
59 //style enqueue
60 wp_enqueue_style( 'galleryBox-effects', plugins_url( '/assets/css/effects.css', __FILE__ ), array(), '1.0', 'all');
61 wp_enqueue_style( 'galleryBox-font-awesome', plugins_url( '/assets/css/font-awesome.min.css', __FILE__ ), array(), '1.0', 'all');
62 wp_enqueue_style( 'galleryBox-justifiedGallery', plugins_url( '/assets/css/justifiedGallery.min.css', __FILE__ ), array(), '1.0', 'all');
63 wp_enqueue_style( 'galleryBox-colabthi-webfont', plugins_url( '/assets/fonts/colabthi-webfont.css', __FILE__ ), array(), '1.0', 'all');
64 wp_enqueue_style( 'galleryBox-style', plugins_url( '/assets/css/galleryBox-style.css', __FILE__ ), array(), '1.0', 'all');
65 //scripts enqueue
66 wp_enqueue_script('jquery');
67 wp_enqueue_script( 'galleryBox-jquery.justifiedGallery', plugins_url( '/assets/js/jquery.justifiedGallery.min.js', __FILE__ ), array( 'jquery' ), '2.5.1', true);
68 wp_enqueue_script( 'galleryBox-jquery.poptrox', plugins_url( '/assets/js/jquery.poptrox.min.js', __FILE__ ), array( 'jquery' ), '2.5.1', true);
69
70 }
71 add_action( 'wp_enqueue_scripts', 'gbox_style_scripts' );
72 endif;
73
74 /**
75 * Admin style enqueue.
76 *
77 * @since 1.0.0
78 */
79 if ( ! function_exists( 'gbox_admin_scripts' ) ) :
80 function gbox_admin_scripts() {
81 wp_enqueue_style('galleryBox_jquery-ui', plugins_url('/assets/css/jquery-ui.css', __FILE__) );
82 wp_enqueue_style('galleryBox_admin', plugins_url('/assets/css/galleryBox-admin.css', __FILE__) );
83
84 wp_enqueue_script( 'galleryBox-jquery-ui', plugins_url( '/assets/js/jquery-ui.min.js', __FILE__ ), array( 'jquery' ), '2.5.1', true);
85 wp_enqueue_script( 'galleryBox-main-admin', plugins_url( '/assets/js/main-admin.js', __FILE__ ), array( 'jquery' ), '2.5.1', true);
86
87 }
88 add_action( 'admin_enqueue_scripts', 'gbox_admin_scripts' );
89 endif;
90 /**
91 * Gallery Box admin role.
92 *
93 */
94 if ( ! function_exists( 'gallerybox_activation_setup' ) ) :
95 function gallerybox_activation_setup() {
96 // Trigger our function that registers the custom post type
97 gallerybox_post_type();
98 // Gallery Box admin style and scripts
99 gbox_admin_scripts();
100
101 // Clear the permalinks after the post type has been registered
102 flush_rewrite_rules();
103 // Add new administrator role
104 gallerybox_admin_role();
105 }
106 register_activation_hook( __FILE__, 'gallerybox_activation_setup' );
107 endif;
108 if ( ! function_exists( 'gallerybox_deactivation_setup' ) ) :
109 function gallerybox_deactivation_setup() {
110
111 // Clear the permalinks to remove our post type's rules
112 flush_rewrite_rules();
113
114 // gets the administrator role remove
115 gallerybox_admin_role_remove();
116
117 }
118 register_deactivation_hook( __FILE__, 'gallerybox_deactivation_setup' );
119 endif;
120 /**
121 * Load plugin textdomain.
122 *
123 * @since 1.0.0
124 */
125 if ( ! function_exists( 'gbox_textdomain' ) ) :
126 function gbox_textdomain() {
127 load_plugin_textdomain( 'gbox', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
128 }
129 add_action( 'plugins_loaded', 'gbox_textdomain' );
130 endif;
131
132 //Add custom image size
133 add_image_size( 'gBox-medium', 450, 450, true );
134 add_image_size( 'gBox-large', 600, 600, true );
135 add_image_size( 'gBox-latest', 800, 900, true );