@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | // autoload_classmap.php @generated by Composer |
4 | 4 | |
5 | -$vendorDir = dirname(dirname(__FILE__)); |
|
6 | -$baseDir = dirname($vendorDir); |
|
5 | +$vendorDir = dirname( dirname( __FILE__ ) ); |
|
6 | +$baseDir = dirname( $vendorDir ); |
|
7 | 7 | |
8 | 8 | return array( |
9 | 9 | 'ComposerAutoloaderInitb5638313a52df4893eb45c04efdaa356' => $vendorDir . '/trustedlogin/client/vendor/composer/autoload_real.php', |
@@ -2,12 +2,12 @@ |
||
2 | 2 | |
3 | 3 | // autoload_psr4.php @generated by Composer |
4 | 4 | |
5 | -$vendorDir = dirname(dirname(__FILE__)); |
|
6 | -$baseDir = dirname($vendorDir); |
|
5 | +$vendorDir = dirname( dirname( __FILE__ ) ); |
|
6 | +$baseDir = dirname( $vendorDir ); |
|
7 | 7 | |
8 | 8 | return array( |
9 | - 'TrustedLogin\\' => array($baseDir . '/src', $vendorDir . '/trustedlogin/client/src'), |
|
10 | - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), |
|
11 | - 'Katzgrau\\KLogger\\' => array($vendorDir . '/katzgrau/klogger/src'), |
|
12 | - 'KatzGrau\\KLogger\\' => array($baseDir . '/src'), |
|
9 | + 'TrustedLogin\\' => array( $baseDir . '/src', $vendorDir . '/trustedlogin/client/src' ), |
|
10 | + 'Psr\\Log\\' => array( $vendorDir . '/psr/log/Psr/Log' ), |
|
11 | + 'Katzgrau\\KLogger\\' => array( $vendorDir . '/katzgrau/klogger/src' ), |
|
12 | + 'KatzGrau\\KLogger\\' => array( $baseDir . '/src' ), |
|
13 | 13 | ); |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | // autoload_files.php @generated by Composer |
4 | 4 | |
5 | -$vendorDir = dirname(dirname(__FILE__)); |
|
6 | -$baseDir = dirname($vendorDir); |
|
5 | +$vendorDir = dirname( dirname( __FILE__ ) ); |
|
6 | +$baseDir = dirname( $vendorDir ); |
|
7 | 7 | |
8 | 8 | return array( |
9 | 9 | '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php', |
@@ -6,48 +6,48 @@ discard block |
||
6 | 6 | |
7 | 7 | class ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d |
8 | 8 | { |
9 | - public static $files = array ( |
|
9 | + public static $files = array( |
|
10 | 10 | '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', |
11 | 11 | '3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php', |
12 | 12 | ); |
13 | 13 | |
14 | - public static $prefixLengthsPsr4 = array ( |
|
14 | + public static $prefixLengthsPsr4 = array( |
|
15 | 15 | 'T' => |
16 | - array ( |
|
16 | + array( |
|
17 | 17 | 'TrustedLogin\\' => 13, |
18 | 18 | ), |
19 | 19 | 'P' => |
20 | - array ( |
|
20 | + array( |
|
21 | 21 | 'Psr\\Log\\' => 8, |
22 | 22 | ), |
23 | 23 | 'K' => |
24 | - array ( |
|
24 | + array( |
|
25 | 25 | 'Katzgrau\\KLogger\\' => 17, |
26 | 26 | 'KatzGrau\\KLogger\\' => 17, |
27 | 27 | ), |
28 | 28 | ); |
29 | 29 | |
30 | - public static $prefixDirsPsr4 = array ( |
|
30 | + public static $prefixDirsPsr4 = array( |
|
31 | 31 | 'TrustedLogin\\' => |
32 | - array ( |
|
32 | + array( |
|
33 | 33 | 0 => __DIR__ . '/../..' . '/src', |
34 | 34 | 1 => __DIR__ . '/..' . '/trustedlogin/client/src', |
35 | 35 | ), |
36 | 36 | 'Psr\\Log\\' => |
37 | - array ( |
|
37 | + array( |
|
38 | 38 | 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', |
39 | 39 | ), |
40 | 40 | 'Katzgrau\\KLogger\\' => |
41 | - array ( |
|
41 | + array( |
|
42 | 42 | 0 => __DIR__ . '/..' . '/katzgrau/klogger/src', |
43 | 43 | ), |
44 | 44 | 'KatzGrau\\KLogger\\' => |
45 | - array ( |
|
45 | + array( |
|
46 | 46 | 0 => __DIR__ . '/../..' . '/src', |
47 | 47 | ), |
48 | 48 | ); |
49 | 49 | |
50 | - public static $classMap = array ( |
|
50 | + public static $classMap = array( |
|
51 | 51 | 'ComposerAutoloaderInitb5638313a52df4893eb45c04efdaa356' => __DIR__ . '/..' . '/trustedlogin/client/vendor/composer/autoload_real.php', |
52 | 52 | 'Composer\\Autoload\\ClassLoader' => __DIR__ . '/..' . '/trustedlogin/client/vendor/composer/ClassLoader.php', |
53 | 53 | 'Composer\\Autoload\\ComposerStaticInitb5638313a52df4893eb45c04efdaa356' => __DIR__ . '/..' . '/trustedlogin/client/vendor/composer/autoload_static.php', |
@@ -178,13 +178,13 @@ discard block |
||
178 | 178 | 'TypeError' => __DIR__ . '/..' . '/paragonie/random_compat/lib/error_polyfill.php', |
179 | 179 | ); |
180 | 180 | |
181 | - public static function getInitializer(ClassLoader $loader) |
|
181 | + public static function getInitializer( ClassLoader $loader ) |
|
182 | 182 | { |
183 | - return \Closure::bind(function () use ($loader) { |
|
183 | + return \Closure::bind( function() use ( $loader ) { |
|
184 | 184 | $loader->prefixLengthsPsr4 = ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$prefixLengthsPsr4; |
185 | 185 | $loader->prefixDirsPsr4 = ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$prefixDirsPsr4; |
186 | 186 | $loader->classMap = ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$classMap; |
187 | 187 | |
188 | - }, null, ClassLoader::class); |
|
188 | + }, null, ClassLoader::class ); |
|
189 | 189 | } |
190 | 190 | } |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | { |
7 | 7 | private static $loader; |
8 | 8 | |
9 | - public static function loadClassLoader($class) |
|
9 | + public static function loadClassLoader( $class ) |
|
10 | 10 | { |
11 | - if ('Composer\Autoload\ClassLoader' === $class) { |
|
11 | + if ( 'Composer\Autoload\ClassLoader' === $class ) { |
|
12 | 12 | require __DIR__ . '/ClassLoader.php'; |
13 | 13 | } |
14 | 14 | } |
@@ -18,47 +18,47 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public static function getLoader() |
20 | 20 | { |
21 | - if (null !== self::$loader) { |
|
21 | + if ( null !== self::$loader ) { |
|
22 | 22 | return self::$loader; |
23 | 23 | } |
24 | 24 | |
25 | 25 | require __DIR__ . '/platform_check.php'; |
26 | 26 | |
27 | - spl_autoload_register(array('ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader'), true, true); |
|
28 | - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); |
|
29 | - spl_autoload_unregister(array('ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader')); |
|
27 | + spl_autoload_register( array( 'ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader' ), true, true ); |
|
28 | + self::$loader = $loader = new \Composer\Autoload\ClassLoader( \dirname( \dirname( __FILE__ ) ) ); |
|
29 | + spl_autoload_unregister( array( 'ComposerAutoloaderInit984ed95bef2b0e3d4eeb0208a88dc67d', 'loadClassLoader' ) ); |
|
30 | 30 | |
31 | - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); |
|
32 | - if ($useStaticLoader) { |
|
31 | + $useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined( 'HHVM_VERSION' ) && ( ! function_exists( 'zend_loader_file_encoded' ) || ! zend_loader_file_encoded() ); |
|
32 | + if ( $useStaticLoader ) { |
|
33 | 33 | require __DIR__ . '/autoload_static.php'; |
34 | 34 | |
35 | - call_user_func(\Composer\Autoload\ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::getInitializer($loader)); |
|
35 | + call_user_func( \Composer\Autoload\ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::getInitializer( $loader ) ); |
|
36 | 36 | } else { |
37 | 37 | $map = require __DIR__ . '/autoload_namespaces.php'; |
38 | - foreach ($map as $namespace => $path) { |
|
39 | - $loader->set($namespace, $path); |
|
38 | + foreach ( $map as $namespace => $path ) { |
|
39 | + $loader->set( $namespace, $path ); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $map = require __DIR__ . '/autoload_psr4.php'; |
43 | - foreach ($map as $namespace => $path) { |
|
44 | - $loader->setPsr4($namespace, $path); |
|
43 | + foreach ( $map as $namespace => $path ) { |
|
44 | + $loader->setPsr4( $namespace, $path ); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $classMap = require __DIR__ . '/autoload_classmap.php'; |
48 | - if ($classMap) { |
|
49 | - $loader->addClassMap($classMap); |
|
48 | + if ( $classMap ) { |
|
49 | + $loader->addClassMap( $classMap ); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | - $loader->register(true); |
|
53 | + $loader->register( true ); |
|
54 | 54 | |
55 | - if ($useStaticLoader) { |
|
55 | + if ( $useStaticLoader ) { |
|
56 | 56 | $includeFiles = Composer\Autoload\ComposerStaticInit984ed95bef2b0e3d4eeb0208a88dc67d::$files; |
57 | 57 | } else { |
58 | 58 | $includeFiles = require __DIR__ . '/autoload_files.php'; |
59 | 59 | } |
60 | - foreach ($includeFiles as $fileIdentifier => $file) { |
|
61 | - composerRequire984ed95bef2b0e3d4eeb0208a88dc67d($fileIdentifier, $file); |
|
60 | + foreach ( $includeFiles as $fileIdentifier => $file ) { |
|
61 | + composerRequire984ed95bef2b0e3d4eeb0208a88dc67d( $fileIdentifier, $file ); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | return $loader; |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | * @param string $file |
71 | 71 | * @return void |
72 | 72 | */ |
73 | -function composerRequire984ed95bef2b0e3d4eeb0208a88dc67d($fileIdentifier, $file) |
|
73 | +function composerRequire984ed95bef2b0e3d4eeb0208a88dc67d( $fileIdentifier, $file ) |
|
74 | 74 | { |
75 | - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { |
|
76 | - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; |
|
75 | + if ( empty( $GLOBALS[ '__composer_autoload_files' ][ $fileIdentifier ] ) ) { |
|
76 | + $GLOBALS[ '__composer_autoload_files' ][ $fileIdentifier ] = true; |
|
77 | 77 | |
78 | 78 | require $file; |
79 | 79 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | - $this->widget_description = __('Display a Gravity Forms form.', 'gravityview' ); |
|
27 | + $this->widget_description = __( 'Display a Gravity Forms form.', 'gravityview' ); |
|
28 | 28 | |
29 | 29 | $default_values = array( |
30 | 30 | 'header' => 1, |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | add_filter( 'gravityview/widget/hide_until_searched/allowlist', array( $this, 'add_to_allowlist' ) ); |
67 | 67 | |
68 | - parent::__construct( __( 'Gravity Forms', 'gravityview' ) , 'gravityforms', $default_values, $settings ); |
|
68 | + parent::__construct( __( 'Gravity Forms', 'gravityview' ), 'gravityforms', $default_values, $settings ); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | function add_to_allowlist( $allowlist ) { |
110 | 110 | |
111 | - $allowlist[] = 'gravityforms'; |
|
111 | + $allowlist[ ] = 'gravityforms'; |
|
112 | 112 | |
113 | 113 | return $allowlist; |
114 | 114 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param string $content |
119 | 119 | * @param string $context |
120 | 120 | */ |
121 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
121 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
122 | 122 | |
123 | 123 | if ( ! $this->pre_render_frontend() ) { |
124 | 124 | return; |
@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // The image source has ?raw=1; don't check for valid image extensions. |
55 | - $image_atts['validate_src'] = false; |
|
55 | + $image_atts[ 'validate_src' ] = false; |
|
56 | 56 | |
57 | 57 | return $image_atts; |
58 | 58 | } |
@@ -26,21 +26,21 @@ discard block |
||
26 | 26 | |
27 | 27 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
28 | 28 | |
29 | - unset( $field_options['search_filter'] ); |
|
29 | + unset( $field_options[ 'search_filter' ] ); |
|
30 | 30 | |
31 | - if( 'edit' === $context ) { |
|
31 | + if ( 'edit' === $context ) { |
|
32 | 32 | return $field_options; |
33 | 33 | } |
34 | 34 | |
35 | - $add_options['link_to_file'] = array( |
|
35 | + $add_options[ 'link_to_file' ] = array( |
|
36 | 36 | 'type' => 'checkbox', |
37 | 37 | 'label' => __( 'Display as a Link:', 'gravityview' ), |
38 | - 'desc' => __('Display the uploaded files as links, rather than embedded content.', 'gravityview'), |
|
38 | + 'desc' => __( 'Display the uploaded files as links, rather than embedded content.', 'gravityview' ), |
|
39 | 39 | 'value' => false, |
40 | 40 | 'merge_tags' => false, |
41 | 41 | ); |
42 | 42 | |
43 | - $add_options['image_width'] = array( |
|
43 | + $add_options[ 'image_width' ] = array( |
|
44 | 44 | 'type' => 'text', |
45 | 45 | 'label' => __( 'Custom Width:', 'gravityview' ), |
46 | 46 | 'desc' => __( 'Override the default image width (250).', 'gravityview' ), |
@@ -158,14 +158,14 @@ discard block |
||
158 | 158 | $base_id = null; |
159 | 159 | |
160 | 160 | $is_single = gravityview_get_context() === 'single'; |
161 | - $lightbox = ! empty( $gravityview_view->atts['lightbox'] ); |
|
161 | + $lightbox = ! empty( $gravityview_view->atts[ 'lightbox' ] ); |
|
162 | 162 | $field_compat = $gravityview_view->getCurrentField(); |
163 | 163 | } |
164 | 164 | |
165 | 165 | $output_arr = array(); |
166 | 166 | |
167 | 167 | // Get an array of file paths for the field. |
168 | - $file_paths = \GV\Utils::get( $field , 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
168 | + $file_paths = \GV\Utils::get( $field, 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
169 | 169 | |
170 | 170 | // The $value JSON was probably truncated; let's check lead_detail_long. |
171 | 171 | if ( ! is_array( $file_paths ) ) { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $rendered = null; |
186 | 186 | |
187 | 187 | // If the site is HTTPS, use HTTPS |
188 | - if ( function_exists('set_url_scheme') ) { |
|
188 | + if ( function_exists( 'set_url_scheme' ) ) { |
|
189 | 189 | $file_path = set_url_scheme( $file_path ); |
190 | 190 | } |
191 | 191 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $file_path_info = pathinfo( $file_path ); |
197 | 197 | |
198 | 198 | // If pathinfo() gave us the extension of the file, run the switch statement using that. |
199 | - $extension = empty( $file_path_info['extension'] ) ? NULL : strtolower( $file_path_info['extension'] ); |
|
199 | + $extension = empty( $file_path_info[ 'extension' ] ) ? NULL : strtolower( $file_path_info[ 'extension' ] ); |
|
200 | 200 | |
201 | 201 | /** |
202 | 202 | * @filter `gravityview/fields/fileupload/extension` Modify the file extension before it's used in display logic |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | $extension = apply_filters( 'gravityview/fields/fileupload/extension', $extension, $file_path ); |
208 | 208 | |
209 | - $basename = $file_path_info['basename']; |
|
209 | + $basename = $file_path_info[ 'basename' ]; |
|
210 | 210 | |
211 | 211 | // Get the secure download URL |
212 | 212 | $is_secure = false; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | $audio_settings = apply_filters( 'gravityview_audio_settings', array( |
248 | 248 | 'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension |
249 | - 'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id'] |
|
249 | + 'class' => 'wp-audio-shortcode gv-audio gv-field-id-' . $field_settings[ 'id' ] |
|
250 | 250 | ), $context ); |
251 | 251 | |
252 | 252 | /** |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | $video_settings = apply_filters( 'gravityview_video_settings', array( |
277 | 277 | 'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension |
278 | - 'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id'] |
|
278 | + 'class' => 'wp-video-shortcode gv-video gv-field-id-' . $field_settings[ 'id' ] |
|
279 | 279 | ), $context ); |
280 | 280 | |
281 | 281 | /** |
@@ -299,20 +299,20 @@ discard block |
||
299 | 299 | $file_path = add_query_arg( array( 'gv-iframe' => 'true' ), $file_path ); |
300 | 300 | } |
301 | 301 | |
302 | - $field_settings['link_to_file'] = true; |
|
302 | + $field_settings[ 'link_to_file' ] = true; |
|
303 | 303 | |
304 | 304 | // Images |
305 | 305 | } else if ( in_array( $extension, GravityView_Image::get_image_extensions() ) ) { |
306 | 306 | $width = \GV\Utils::get( $field_settings, 'image_width', 250 ); |
307 | 307 | $image_atts = array( |
308 | 308 | 'src' => $file_path, |
309 | - 'class' => 'gv-image gv-field-id-' . $field_settings['id'], |
|
310 | - 'alt' => $field_settings['label'], |
|
311 | - 'width' => ( $is_single ? null : ( $width ? $width: 250 ) ) |
|
309 | + 'class' => 'gv-image gv-field-id-' . $field_settings[ 'id' ], |
|
310 | + 'alt' => $field_settings[ 'label' ], |
|
311 | + 'width' => ( $is_single ? null : ( $width ? $width : 250 ) ) |
|
312 | 312 | ); |
313 | 313 | |
314 | 314 | if ( $is_secure ) { |
315 | - $image_atts['validate_src'] = false; |
|
315 | + $image_atts[ 'validate_src' ] = false; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | unset( $gv_entry ); |
335 | 335 | |
336 | - if ( $lightbox && empty( $field_settings['show_as_link'] ) ) { |
|
336 | + if ( $lightbox && empty( $field_settings[ 'show_as_link' ] ) ) { |
|
337 | 337 | |
338 | 338 | $lightbox_link_atts = array( |
339 | 339 | 'rel' => sprintf( "%s-%s", $gv_class, $entry_slug ), |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | // Show as link should render the image regardless. |
351 | - if ( ! empty( $field_settings['show_as_link'] ) ) { |
|
351 | + if ( ! empty( $field_settings[ 'show_as_link' ] ) ) { |
|
352 | 352 | $text = $rendered; |
353 | 353 | } |
354 | 354 | } |
355 | 355 | // For all other non-media file types (ZIP, for example), always show as a link regardless of setting. |
356 | 356 | else { |
357 | - $field_settings['link_to_file'] = true; |
|
357 | + $field_settings[ 'link_to_file' ] = true; |
|
358 | 358 | $disable_lightbox = true; |
359 | 359 | } |
360 | 360 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $disable_wrapped_link = apply_filters( 'gravityview/fields/fileupload/disable_link', false, $field_compat, $context ); |
371 | 371 | |
372 | 372 | // Output textualized content where |
373 | - if ( ! $disable_wrapped_link && ( ! empty( $field_settings['link_to_file'] ) || ! empty( $field_settings['show_as_link'] ) ) ) { |
|
373 | + if ( ! $disable_wrapped_link && ( ! empty( $field_settings[ 'link_to_file' ] ) || ! empty( $field_settings[ 'show_as_link' ] ) ) ) { |
|
374 | 374 | /** |
375 | 375 | * Modify the link text (defaults to the file name) |
376 | 376 | * |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | $content = apply_filters( 'gravityview/fields/fileupload/link_content', $text, $field_compat, $context ); |
385 | 385 | |
386 | - if ( empty( $field_settings['show_as_link'] ) ) { |
|
386 | + if ( empty( $field_settings[ 'show_as_link' ] ) ) { |
|
387 | 387 | /** |
388 | 388 | * @filter `gravityview/fields/fileupload/link_atts` Modify the link attributes for a file upload field |
389 | 389 | * @since 2.0 Added $context |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $content = empty( $rendered ) ? $text : $rendered; |
405 | 405 | } |
406 | 406 | |
407 | - $output_arr[] = array( |
|
407 | + $output_arr[ ] = array( |
|
408 | 408 | 'file_path' => $file_path, |
409 | 409 | 'content' => $content |
410 | 410 | ); |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | |
66 | 66 | $atts = wp_parse_args( $atts, $defaults ); |
67 | 67 | |
68 | - foreach( $atts as $key => $val ) { |
|
68 | + foreach ( $atts as $key => $val ) { |
|
69 | 69 | $this->{$key} = $val; |
70 | 70 | } |
71 | 71 | |
72 | - $this->class = !empty( $this->class ) ? esc_attr( implode( ' ', (array)$this->class ) ) : $this->class; |
|
72 | + $this->class = ! empty( $this->class ) ? esc_attr( implode( ' ', (array)$this->class ) ) : $this->class; |
|
73 | 73 | |
74 | 74 | $this->set_image_size(); |
75 | 75 | |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | */ |
86 | 86 | function validate_image_src() { |
87 | 87 | |
88 | - if ( !$this->validate_src ) { return true; } |
|
88 | + if ( ! $this->validate_src ) { return true; } |
|
89 | 89 | |
90 | 90 | $info = pathinfo( $this->src ); |
91 | 91 | |
92 | 92 | $image_exts = self::get_image_extensions(); |
93 | 93 | |
94 | - return isset( $info['extension'] ) && in_array( strtolower( $info['extension'] ), $image_exts); |
|
94 | + return isset( $info[ 'extension' ] ) && in_array( strtolower( $info[ 'extension' ] ), $image_exts ); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | $image_exts = apply_filters( 'gravityview_image_extensions', array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'webp' ) ); |
111 | 111 | |
112 | - return (array) $image_exts; |
|
112 | + return (array)$image_exts; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -125,16 +125,16 @@ discard block |
||
125 | 125 | |
126 | 126 | // And there is no string size passed |
127 | 127 | // And we want to get the image size using PHP |
128 | - if ( empty( $string ) && !empty( $this->getimagesize ) ) { |
|
128 | + if ( empty( $string ) && ! empty( $this->getimagesize ) ) { |
|
129 | 129 | |
130 | 130 | $image_size = @getimagesize( $this->src ); |
131 | 131 | |
132 | 132 | // If it didn't return a response, it may be a HTTPS/SSL error |
133 | - if ( empty( $image_size[0] ) ) { |
|
133 | + if ( empty( $image_size[ 0 ] ) ) { |
|
134 | 134 | $image_size = @getimagesize( set_url_scheme( $this->src, 'http' ) ); |
135 | 135 | } |
136 | 136 | |
137 | - if ( !empty( $image_size ) ) { |
|
137 | + if ( ! empty( $image_size ) ) { |
|
138 | 138 | list( $width, $height ) = $image_size; |
139 | 139 | } |
140 | 140 | |
@@ -147,33 +147,33 @@ discard block |
||
147 | 147 | * @param array $image_sizes Array of image sizes with the key being the size slug, and the value being an array with `width` and `height` defined, in pixels |
148 | 148 | */ |
149 | 149 | $image_sizes = apply_filters( 'gravityview_image_sizes', array( |
150 | - 'tiny' => array('width' => 40, 'height' => 30), |
|
151 | - 'small' => array('width' => 100, 'height' => 75), |
|
152 | - 'medium' => array('width' => 250, 'height' => 188), |
|
153 | - 'large' => array('width' => 448, 'height' => 336), |
|
150 | + 'tiny' => array( 'width' => 40, 'height' => 30 ), |
|
151 | + 'small' => array( 'width' => 100, 'height' => 75 ), |
|
152 | + 'medium' => array( 'width' => 250, 'height' => 188 ), |
|
153 | + 'large' => array( 'width' => 448, 'height' => 336 ), |
|
154 | 154 | ) ); |
155 | 155 | |
156 | - switch( $this->size ) { |
|
156 | + switch ( $this->size ) { |
|
157 | 157 | case 'tiny': |
158 | - extract($image_sizes['tiny']); |
|
158 | + extract( $image_sizes[ 'tiny' ] ); |
|
159 | 159 | break; |
160 | 160 | case 'small': |
161 | 161 | case 's': |
162 | 162 | case 'thumb': |
163 | - extract($image_sizes['small']); |
|
163 | + extract( $image_sizes[ 'small' ] ); |
|
164 | 164 | break; |
165 | 165 | case 'm': |
166 | 166 | case 'medium': |
167 | - extract($image_sizes['medium']); |
|
167 | + extract( $image_sizes[ 'medium' ] ); |
|
168 | 168 | break; |
169 | 169 | case 'large': |
170 | 170 | case 'l': |
171 | - extract($image_sizes['large']); |
|
171 | + extract( $image_sizes[ 'large' ] ); |
|
172 | 172 | break; |
173 | 173 | default: |
174 | 174 | // Verify that the passed sizes are integers. |
175 | - $width = !empty( $width ) ? intval( $width ) : intval( $this->width ); |
|
176 | - $height = !empty( $height ) ? intval( $height ) : intval( $this->height ); |
|
175 | + $width = ! empty( $width ) ? intval( $width ) : intval( $this->width ); |
|
176 | + $height = ! empty( $height ) ? intval( $height ) : intval( $this->height ); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | } |