Changeset 3134296
- Timestamp:
- 08/12/2024 02:33:43 PM (18 months ago)
- Location:
- dynamicconditions
- Files:
-
- 65 added
- 4 edited
-
tags/1.7.4 (added)
-
tags/1.7.4/Admin (added)
-
tags/1.7.4/Admin/DynamicConditionsAdmin.php (added)
-
tags/1.7.4/Admin/css (added)
-
tags/1.7.4/Admin/css/dynamic-conditions-admin.css (added)
-
tags/1.7.4/Admin/index.php (added)
-
tags/1.7.4/Admin/js (added)
-
tags/1.7.4/Admin/js/dynamic-conditions-admin.js (added)
-
tags/1.7.4/Admin/js/index.php (added)
-
tags/1.7.4/Admin/partials (added)
-
tags/1.7.4/Admin/partials/dynamic-conditions-admin-display.php (added)
-
tags/1.7.4/Admin/partials/index.php (added)
-
tags/1.7.4/LICENSE.txt (added)
-
tags/1.7.4/Legacy (added)
-
tags/1.7.4/Legacy/Lib (added)
-
tags/1.7.4/Legacy/Lib/DynamicConditionsDate.php (added)
-
tags/1.7.4/Legacy/Lib/index.php (added)
-
tags/1.7.4/Legacy/WeakMap_Fallback.php (added)
-
tags/1.7.4/Legacy/index.php (added)
-
tags/1.7.4/Lib (added)
-
tags/1.7.4/Lib/Activator.php (added)
-
tags/1.7.4/Lib/Date.php (added)
-
tags/1.7.4/Lib/Deactivator.php (added)
-
tags/1.7.4/Lib/DynamicConditions.php (added)
-
tags/1.7.4/Lib/DynamicTags (added)
-
tags/1.7.4/Lib/DynamicTags/NumberPostsTag.php (added)
-
tags/1.7.4/Lib/DynamicTags/index.php (added)
-
tags/1.7.4/Lib/I18n.php (added)
-
tags/1.7.4/Lib/Loader.php (added)
-
tags/1.7.4/Lib/index.php (added)
-
tags/1.7.4/Public (added)
-
tags/1.7.4/Public/DynamicConditionsPublic.php (added)
-
tags/1.7.4/Public/css (added)
-
tags/1.7.4/Public/css/debug.css (added)
-
tags/1.7.4/Public/css/dynamic-conditions-public.css (added)
-
tags/1.7.4/Public/css/index.php (added)
-
tags/1.7.4/Public/index.php (added)
-
tags/1.7.4/Public/js (added)
-
tags/1.7.4/Public/js/dynamic-conditions-public.js (added)
-
tags/1.7.4/Public/js/index.php (added)
-
tags/1.7.4/Public/partials (added)
-
tags/1.7.4/Public/partials/debug.php (added)
-
tags/1.7.4/Public/partials/dynamic-conditions-public-display.php (added)
-
tags/1.7.4/Public/partials/index.php (added)
-
tags/1.7.4/README.txt (added)
-
tags/1.7.4/composer.json (added)
-
tags/1.7.4/dynamic-conditions.php (added)
-
tags/1.7.4/index.php (added)
-
tags/1.7.4/languages (added)
-
tags/1.7.4/languages/dynamicconditions-de_DE.mo (added)
-
tags/1.7.4/languages/dynamicconditions-de_DE.po (added)
-
tags/1.7.4/languages/dynamicconditions.pot (added)
-
tags/1.7.4/languages/index.php (added)
-
tags/1.7.4/uninstall.php (added)
-
tags/1.7.4/vendor (added)
-
tags/1.7.4/vendor/autoload.php (added)
-
tags/1.7.4/vendor/composer (added)
-
tags/1.7.4/vendor/composer/ClassLoader.php (added)
-
tags/1.7.4/vendor/composer/LICENSE (added)
-
tags/1.7.4/vendor/composer/autoload_classmap.php (added)
-
tags/1.7.4/vendor/composer/autoload_namespaces.php (added)
-
tags/1.7.4/vendor/composer/autoload_psr4.php (added)
-
tags/1.7.4/vendor/composer/autoload_real.php (added)
-
tags/1.7.4/vendor/composer/autoload_static.php (added)
-
tags/1.7.4/vendor/composer/installed.json (added)
-
trunk/Lib/Date.php (modified) (1 diff)
-
trunk/Public/DynamicConditionsPublic.php (modified) (7 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/dynamic-conditions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dynamicconditions/trunk/Lib/Date.php
r3098518 r3134296 97 97 */ 98 98 public static function unTranslateDate( $needle = '', $setLocale = null ) { 99 if (empty($needle)) { 100 return $needle; 101 } 99 102 // get in translated lang 100 103 $translatedMonths = self::getMonthsTranslated(); -
dynamicconditions/trunk/Public/DynamicConditionsPublic.php
r3134117 r3134296 44 44 45 45 /** 46 * Cache to store a widget's dynamic condition properties.47 * Provides compatibility with php 8.2+ after deprecation of dynamic properties.48 *49 46 * @access private 50 * @var array $ widgetCache For storing dynamic condition data by widget.51 */ 52 private array $ widgetCache= [];47 * @var array $isSectionHidden For storing hidden-status 48 */ 49 private array $isSectionHidden = []; 53 50 54 51 private Date $dateInstance; … … 73 70 */ 74 71 private function getElementSettings( $element ): array { 75 $id = $element->get_id(); 72 $id = get_the_id(). '-'. $element->get_id(); 73 74 if ( !empty( $this->elementSettings[$id] ) ) { 75 return $this->elementSettings[$id]; 76 } 76 77 $clonedElement = clone $element; 77 78 … … 300 301 } 301 302 303 $id = get_the_id() .'-'. $section->get_id(); 304 $this->isSectionHidden[$id] = true; 302 305 303 306 //prevent shortcodes from execution 304 $this->shortcodeTags = $GLOBALS['shortcode_tags'];307 $this->shortcodeTags += $GLOBALS['shortcode_tags']; 305 308 $GLOBALS['shortcode_tags'] = []; 306 309 307 310 ob_start(); 308 $this->widgetCache[$section->get_id()] = [309 'isHidden' => true,310 'settings' => $settings,311 #'ob_level' => ob_get_level(),312 ];313 311 } 314 312 … … 319 317 */ 320 318 public function filterSectionContentAfter( $section ): void { 319 $id = get_the_id() .'-'. $section->get_id(); 321 320 // reset shortcode tags 322 321 $GLOBALS['shortcode_tags'] += $this->shortcodeTags; 323 if ( empty( $section ) || empty( $this->widgetCache[$section->get_id()]['isHidden'] ) ) { 322 if ( empty( $section ) || 323 empty( $this->isSectionHidden[$id] ) 324 ) { 324 325 return; 325 326 } … … 333 334 $matchesStyleTags = []; 334 335 335 336 336 $type = $section->get_type(); 337 $settings = $this-> widgetCache[$section->get_id()]['settings'];337 $settings = $this->elementSettings[$id]; 338 338 339 339 if ( empty( $settings['dynamicconditions_removeStyles'] ) ) { … … 360 360 } 361 361 362 363 echo "<!-- hidden $type {$section->get_id()} -->"; 362 echo "<!-- hidden $type $id -->"; 364 363 } 365 364 … … 375 374 return false; 376 375 } 377 if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') {376 /*if ( filter_input( INPUT_SERVER, 'REQUEST_METHOD' ) === 'POST' ) { 378 377 return false; 379 } 378 }*/ 380 379 381 380 // loop values -
dynamicconditions/trunk/README.txt
r3134117 r3134296 6 6 Requires PHP: 7.4 7 7 Tested up to: 6.6 8 Stable tag: 1.7. 38 Stable tag: 1.7.4 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 66 66 67 67 == Changelog == 68 = 1.7.4 = 69 * Fix big issue with loops destroying everything 70 68 71 = 1.7.3 = 69 72 * Fix issue with date-conditions -
dynamicconditions/trunk/dynamic-conditions.php
r3134117 r3134296 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. 325 * Version: 1.7.4 26 26 * Author: RTO GmbH 27 27 * Author URI: https://www.rto.de … … 37 37 } 38 38 39 define( 'DynamicConditions_VERSION', '1.7. 3' );39 define( 'DynamicConditions_VERSION', '1.7.4' ); 40 40 41 41 define( 'DynamicConditions_DIR', str_replace( '\\', '/', __DIR__ ) );
Note: See TracChangeset
for help on using the changeset viewer.