PluginProbe
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more / 3.7.1
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more v3.7.1
3.7.2 3.7.1 3.7.0 3.6.0 3.6.1 3.5.2 trunk 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.6.0 2.6.1 All 73 releases
← All changes | stockpack.php +56 -6 2.6.1 → 3.7.1 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /*
3 3 * Plugin Name: StockPack – Stock images in WordPress
4 4 * Plugin URI: https://wordpress.org/plugins/stockpack/
5 - * Description: Direct image search in WordPress for Unsplash, Adobe Stock, Pixabay, Pexels and Deposit Photos
5 + * Description: Direct image search in WordPress for Unsplash, Adobe Stock, Getty Images, iStock, Pixabay, Pexels and Deposit Photos
6 6 * Author: Derikon Development
7 7 * Author URI: https://derikon.com/
8 - * Version: 2.6.1
8 + * Version:3.7.1
9 9 * Text Domain: stockpack
10 10 * Domain Path: /languages
11 11 *
12 12 * Copyright (c) 2016 Derikon Development
@@ -18,9 +18,9 @@
18 18 *
19 19 * This program is distributed in the hope that it will be useful,
20 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 - * GNU General Public License for more details.xdebu
22 + * GNU General Public License for more details
23 23 *
24 24 * You should have received a copy of the GNU General Public License
25 25 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 26 */
@@ -27,8 +27,10 @@
27 27
28 28
29 29 require( __DIR__ . '/vendor/autoload.php' );
30 30
31 +define( 'STOCKPACK_DIR', __FILE__ );
32 +
31 33 if ( ! class_exists( 'Stockpack' ) ) {
32 34 class Stockpack {
33 35
34 36 /**
@@ -44,8 +46,14 @@
44 46
45 47 /** @var StockpackQuery */
46 48 public $query;
47 49
50 + /** @var StockpackCaptions */
51 + public $captions;
52 +
53 + /** @var StockpackSettings */
54 + public $settings;
55 +
48 56 /**
49 57 * Returns the *Singleton* instance of this class.
50 58 *
51 59 * @return Singleton The *Singleton* instance.
@@ -91,8 +99,10 @@
91 99 public function dependencies() {
92 100 $this->admin = \StockpackAdmin::get_instance();
93 101 $this->media = \StockpackMedia::get_instance();
94 102 $this->query = \StockpackQuery::get_instance();
103 + $this->captions = \StockpackCaptions::get_instance();
104 + $this->settings = \StockpackSettings::get_instance();
95 105 }
96 106
97 107 /**
98 108 * Adds plugin action links
@@ -121,14 +131,54 @@
121 131 }
122 132
123 133 }
124 134
125 -
126 135 add_action( 'after_setup_theme', 'stockpack_register_plugin' );
127 136 function stockpack_register_plugin() {
128 - $stockpack_start = apply_filters( 'load_stockpack', true );
129 - if ( $stockpack_start ) {
137 + $load_stockpack = true;
138 + if ( ! is_admin()) {
139 + $load_stockpack = false;
140 + }
141 +
142 + $stockpack_start = apply_filters( 'load_stockpack', $load_stockpack );
143 + if ( $stockpack_start || stockpack_frontend_load() || stockpack_cli_load() ) {
130 144 $GLOBALS['stockpack'] = Stockpack::get_instance();
131 145 }
132 146 }
147 +
148 + function stockpack_frontend_load() {
149 + $load = false;
150 + if ( isset( $_GET['et_fb'] ) || isset ( $_GET['bricks'] ) || isset ( $_GET['ct_builder'] ) || (isset( $_GET['fl_builder']) && !isset($_GET['fl_builder_ui_iframe']) ) || isset( $_GET['fb-edit'] ) || isset( $_GET['brizy-edit-iframe'] ) ) {
151 + $load = true;
152 + }
153 +
154 + return apply_filters( 'frontend_load_stockpack', $load );
155 + }
156 +
157 + function stockpack_early_admin_enqueue(){
158 + return isset($_GET['breakdance_wpuiforbuilder_media']);
159 + }
160 +
161 + function stockpack_cli_load() {
162 + $load = false;
163 + if ( defined( 'WP_CLI' ) && WP_CLI ) {
164 + WP_CLI::add_command( 'stockpack', 'StockpackCLI' );
165 + $load = true;
166 + }
167 +
168 + return apply_filters( 'cli_load_stockpack', $load );
169 + }
170 +
171 + function stockpack_late_init() {
172 + global $stockpack;
173 + // if loaded bail
174 + if ( $stockpack ) {
175 + return false;
176 + }
177 + stockpack_register_plugin();
178 +
179 + }
180 +
181 + add_action( 'get_header', 'stockpack_late_init' );
182 +
133 183 }
134 184