PluginProbe
PhastPress / 1.95
PhastPress v1.95
3.12 3.11 1.75 1.76 1.77 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.90 1.91 1.92 1.93 1.94 1.95 1.96 1.97 All 119 releases
phastpress / classes / Compat / NextGenGallery.php

NextGenGallery.php in PhastPress 1.95, at classes/Compat/NextGenGallery.php

30 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Kibo\PhastPlugins\PhastPress\Compat;
3
4 use ReflectionClass;
5 use ReflectionException;
6
7 class NextGenGallery {
8 public function setup($deploymentPriority) {
9 try {
10 $class = new ReflectionClass('C_Photocrati_Resource_Manager');
11 $resourceManager = $class->getStaticPropertyValue('instance');
12 } catch (ReflectionException $e) {
13 return;
14 }
15
16 if ($resourceManager
17 && ($resourceManagerPriority = has_filter('init', [$resourceManager, 'start_buffer'])) !== false
18 && $resourceManagerPriority < $deploymentPriority
19 ) {
20 Log::add(
21 'nextgen-gallery',
22 'moving NextGEN Gallery resource manager hook after PhastPress deployment ' .
23 'to support WP Super Cache late init'
24 );
25 remove_action('init', [$resourceManager, 'start_buffer'], $resourceManagerPriority);
26 add_action('init', [$resourceManager, 'start_buffer'], $deploymentPriority);
27 }
28 }
29 }
30