Changeset 3133362
- Timestamp:
- 08/10/2024 12:50:55 AM (18 months ago)
- Location:
- dynamicconditions
- Files:
-
- 65 added
- 4 edited
-
tags/1.7.2 (added)
-
tags/1.7.2/Admin (added)
-
tags/1.7.2/Admin/DynamicConditionsAdmin.php (added)
-
tags/1.7.2/Admin/css (added)
-
tags/1.7.2/Admin/css/dynamic-conditions-admin.css (added)
-
tags/1.7.2/Admin/index.php (added)
-
tags/1.7.2/Admin/js (added)
-
tags/1.7.2/Admin/js/dynamic-conditions-admin.js (added)
-
tags/1.7.2/Admin/js/index.php (added)
-
tags/1.7.2/Admin/partials (added)
-
tags/1.7.2/Admin/partials/dynamic-conditions-admin-display.php (added)
-
tags/1.7.2/Admin/partials/index.php (added)
-
tags/1.7.2/LICENSE.txt (added)
-
tags/1.7.2/Legacy (added)
-
tags/1.7.2/Legacy/Lib (added)
-
tags/1.7.2/Legacy/Lib/DynamicConditionsDate.php (added)
-
tags/1.7.2/Legacy/Lib/index.php (added)
-
tags/1.7.2/Legacy/WeakMap_Fallback.php (added)
-
tags/1.7.2/Legacy/index.php (added)
-
tags/1.7.2/Lib (added)
-
tags/1.7.2/Lib/Activator.php (added)
-
tags/1.7.2/Lib/Date.php (added)
-
tags/1.7.2/Lib/Deactivator.php (added)
-
tags/1.7.2/Lib/DynamicConditions.php (added)
-
tags/1.7.2/Lib/DynamicTags (added)
-
tags/1.7.2/Lib/DynamicTags/NumberPostsTag.php (added)
-
tags/1.7.2/Lib/DynamicTags/index.php (added)
-
tags/1.7.2/Lib/I18n.php (added)
-
tags/1.7.2/Lib/Loader.php (added)
-
tags/1.7.2/Lib/index.php (added)
-
tags/1.7.2/Public (added)
-
tags/1.7.2/Public/DynamicConditionsPublic.php (added)
-
tags/1.7.2/Public/css (added)
-
tags/1.7.2/Public/css/debug.css (added)
-
tags/1.7.2/Public/css/dynamic-conditions-public.css (added)
-
tags/1.7.2/Public/css/index.php (added)
-
tags/1.7.2/Public/index.php (added)
-
tags/1.7.2/Public/js (added)
-
tags/1.7.2/Public/js/dynamic-conditions-public.js (added)
-
tags/1.7.2/Public/js/index.php (added)
-
tags/1.7.2/Public/partials (added)
-
tags/1.7.2/Public/partials/debug.php (added)
-
tags/1.7.2/Public/partials/dynamic-conditions-public-display.php (added)
-
tags/1.7.2/Public/partials/index.php (added)
-
tags/1.7.2/README.txt (added)
-
tags/1.7.2/composer.json (added)
-
tags/1.7.2/dynamic-conditions.php (added)
-
tags/1.7.2/index.php (added)
-
tags/1.7.2/languages (added)
-
tags/1.7.2/languages/dynamicconditions-de_DE.mo (added)
-
tags/1.7.2/languages/dynamicconditions-de_DE.po (added)
-
tags/1.7.2/languages/dynamicconditions.pot (added)
-
tags/1.7.2/languages/index.php (added)
-
tags/1.7.2/uninstall.php (added)
-
tags/1.7.2/vendor (added)
-
tags/1.7.2/vendor/autoload.php (added)
-
tags/1.7.2/vendor/composer (added)
-
tags/1.7.2/vendor/composer/ClassLoader.php (added)
-
tags/1.7.2/vendor/composer/LICENSE (added)
-
tags/1.7.2/vendor/composer/autoload_classmap.php (added)
-
tags/1.7.2/vendor/composer/autoload_namespaces.php (added)
-
tags/1.7.2/vendor/composer/autoload_psr4.php (added)
-
tags/1.7.2/vendor/composer/autoload_real.php (added)
-
tags/1.7.2/vendor/composer/autoload_static.php (added)
-
tags/1.7.2/vendor/composer/installed.json (added)
-
trunk/Legacy/WeakMap_Fallback.php (modified) (1 diff)
-
trunk/Public/DynamicConditionsPublic.php (modified) (8 diffs)
-
trunk/README.txt (modified) (1 diff)
-
trunk/dynamic-conditions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dynamicconditions/trunk/Legacy/WeakMap_Fallback.php
r3132763 r3133362 9 9 } 10 10 11 public function offsetGet($offset) { 11 /** 12 * @param mixed $offset 13 * @return mixed|null 14 */ 15 public function offsetGet( $offset) { 12 16 return $this->storage[spl_object_id($offset)] ?? null; 13 17 } -
dynamicconditions/trunk/Public/DynamicConditionsPublic.php
r3132825 r3133362 23 23 if ( !defined( 'ABSPATH' ) ) { 24 24 die; 25 }26 27 if ( !class_exists( 'WeakMap' ) ) {28 include_once DynamicConditions_DIR . '/Legacy/WeakMap_Fallback.php';29 25 } 30 26 … … 52 48 * 53 49 * @access private 54 * @var \WeakMap$widgetCache For storing dynamic condition data by widget.55 */ 56 private \WeakMap $widgetCache;50 * @var array $widgetCache For storing dynamic condition data by widget. 51 */ 52 private array $widgetCache = []; 57 53 58 54 private Date $dateInstance; … … 70 66 $this->version = $version; 71 67 $this->dateInstance = new Date(); 72 73 $this->widgetCache = new \WeakMap();74 68 } 75 69 … … 306 300 } 307 301 308 $this->widgetCache[$section] = [309 'isHidden' => true,310 'settings' => $settings,311 ];312 302 313 303 //prevent shortcodes from execution … … 316 306 317 307 ob_start(); 308 $this->widgetCache[$section->get_id()] = [ 309 'isHidden' => true, 310 'settings' => $settings, 311 'ob_level' => ob_get_level(), 312 ]; 318 313 } 319 314 … … 326 321 // reset shortcode tags 327 322 $GLOBALS['shortcode_tags'] += $this->shortcodeTags; 328 if ( empty( $section ) || empty( $this->widgetCache[$section]['isHidden'] ) ) { 329 return; 323 if ( empty( $section ) || empty( $this->widgetCache[$section->get_id()]['isHidden'] ) ) { 324 return; 325 } 326 327 while (ob_get_level() > $this->widgetCache[$section->get_id()]['ob_level']) { 328 ob_end_flush(); 330 329 } 331 330 … … 336 335 337 336 $type = $section->get_type(); 338 $settings = $this->widgetCache[$section ]['settings'];337 $settings = $this->widgetCache[$section->get_id()]['settings']; 339 338 340 339 if ( empty( $settings['dynamicconditions_removeStyles'] ) ) { … … 362 361 363 362 364 echo "<!-- hidden $type -->";363 echo "<!-- hidden $type {$section->get_id()} -->"; 365 364 } 366 365 -
dynamicconditions/trunk/README.txt
r3132825 r3133362 66 66 67 67 == Changelog == 68 = 1.7.2 = 69 * Fix issue with broken layout caused by weakmap and ob_cache 70 68 71 = 1.7.1 = 69 72 * Hotfix issue when element is no Base_Element -
dynamicconditions/trunk/dynamic-conditions.php
r3132825 r3133362 23 23 * Plugin URI: https://github.com/RTO-Websites/dynamic-conditions 24 24 * Description: Activates conditions for dynamic tags to show/hides a widget. 25 * Version: 1.7. 125 * Version: 1.7.2 26 26 * Author: RTO GmbH 27 27 * Author URI: https://www.rto.de … … 37 37 } 38 38 39 define( 'DynamicConditions_VERSION', '1.7. 1' );39 define( 'DynamicConditions_VERSION', '1.7.2' ); 40 40 41 41 define( 'DynamicConditions_DIR', str_replace( '\\', '/', __DIR__ ) );
Note: See TracChangeset
for help on using the changeset viewer.