Changeset 3490507
- Timestamp:
- 03/25/2026 05:01:33 AM (4 days ago)
- Location:
- smntcs-simple-events-widget
- Files:
-
- 2 added
- 2 deleted
- 14 edited
- 1 copied
-
tags/2.5 (copied) (copied from smntcs-simple-events-widget/trunk)
-
tags/2.5/README.md (modified) (3 diffs)
-
tags/2.5/README.txt (modified) (4 diffs)
-
tags/2.5/composer.json (modified) (3 diffs)
-
tags/2.5/composer.lock (modified) (34 diffs)
-
tags/2.5/includes/class-smntcs-simple-events-widget.php (modified) (7 diffs)
-
tags/2.5/includes/class-smntcs-simple-events.php (modified) (5 diffs)
-
tags/2.5/phpcs.dist.xml (deleted)
-
tags/2.5/phpcs.xml (added)
-
tags/2.5/smntcs-simple-events-widget.php (modified) (1 diff)
-
trunk/README.md (modified) (3 diffs)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/composer.json (modified) (3 diffs)
-
trunk/composer.lock (modified) (34 diffs)
-
trunk/includes/class-smntcs-simple-events-widget.php (modified) (7 diffs)
-
trunk/includes/class-smntcs-simple-events.php (modified) (5 diffs)
-
trunk/phpcs.dist.xml (deleted)
-
trunk/phpcs.xml (added)
-
trunk/smntcs-simple-events-widget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
smntcs-simple-events-widget/tags/2.5/README.md
r3260220 r3490507 10 10  11 11 12 Sidebar widget to show (upcoming and previous) events. 12 Add event dates to your content and list upcoming or past events in a classic sidebar widget. 13 14 **SMNTCS Simple Events Widget** is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site. 15 16 You pick a start date and, if you want, an end date, right in the editor. Then you drop the **Simple Events Widget** into a widget area and choose whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates follow your site’s language and date format. 17 18 - Event fields (with date picker) on posts, pages, and on products when WooCommerce is active 19 - Widget: upcoming events, previous events, or both 20 - Display start date only or start and end date 21 - Sort order and optional line break between date and title 22 - Classic WordPress widget—use **Customize → Widgets** or your theme’s widget regions 13 23 14 24 ## Installation … … 19 29 4. If wanted, also provide an end date of the event. 20 30 5. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar. 21 6. Adjust the widget settings according to you needs.31 6. Adjust the widget settings according to your needs. 22 32 23 33 ## Plugin page … … 26 36 27 37 ## Changelog 38 39 ### 2.5 (2025.03.25) 40 41 - Tested up to WordPress 6.9 42 - Add widget options for event sort order and line break between date and title 43 - Use date_i18n for localized date output 44 - Include WooCommerce products when querying events 45 - Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions 28 46 29 47 ### 2.4 (2025.03.23) -
smntcs-simple-events-widget/tags/2.5/README.txt
r3260220 r3490507 3 3 Contributors: nielslange 4 4 Tags: Simple Events, Event, Widget, Sidebar 5 Stable tag: 2. 46 Tested up to: 6. 85 Stable tag: 2.5 6 Tested up to: 6.9 7 7 Requires at least: 3.4 8 8 Requires PHP: 7.4 … … 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Sidebar widget to show (upcoming and previous) events.12 Add event dates to your content and list upcoming or past events in a classic sidebar widget. 13 13 14 14 == Description == 15 15 16 Sidebar widget to show (upcoming and previous) events. 16 SMNTCS Simple Events Widget is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site. 17 18 You pick a start date and, if you want, an end date, right in the editor. Then you drop the *Simple Events Widget* into a widget area and decide whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates respect your site’s language and date format. 19 20 * Event fields (with date picker) on posts, pages, and on products when WooCommerce is active 21 * Widget: upcoming events, previous events, or both 22 * Display start date only or start and end date 23 * Sort order and optional line break between date and title 24 * Classic WordPress widget—place it under **Customize → Widgets** or in your theme’s widget regions 17 25 18 26 == Installation == … … 23 31 4. If wanted, also provide an end date of the event. 24 32 5. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar. 25 6. Adjust the widget settings according to you needs.33 6. Adjust the widget settings according to your needs. 26 34 27 35 == Screenshots == … … 32 40 33 41 == Changelog == 42 43 = 2.5 (2025.03.25) = 44 45 - Tested up to WordPress 6.9 46 - Add widget options for event sort order and line break between date and title 47 - Use date_i18n for localized date output 48 - Include WooCommerce products when querying events 49 - Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions 34 50 35 51 = 2.4 (2025.03.23) -
smntcs-simple-events-widget/tags/2.5/composer.json
r2651293 r3490507 4 4 "homepage": "https://wordpress.org/plugins/smntcs-simple-events-widget/", 5 5 "type": "wordpress-plugin", 6 "keywords": [ 7 "WordPress", 8 "Plugin", 9 "SMNTCS Simple Events Widget" 10 ], 11 "license": "GPL-2.0-or-later", 6 12 "authors": [ 7 13 { … … 10 16 } 11 17 ], 12 "require": {13 "php": ">=7.0"14 },15 18 "require-dev": { 16 19 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", … … 18 21 "overtrue/phplint": "^2.3", 19 22 "phpcompatibility/phpcompatibility-wp": "^2.1", 20 "squizlabs/php_codesniffer": "^3. 6",23 "squizlabs/php_codesniffer": "^3.12", 21 24 "vimeo/psalm": "^4.7", 22 "wp-coding-standards/wpcs": "^ 2.3"25 "wp-coding-standards/wpcs": "^3.1" 23 26 }, 24 27 "scripts": { 25 "phpcbf": "phpcbf --standard=phpcs. dist.xml .",26 "phpcs": "phpcs --standard=phpcs. dist.xml .",28 "phpcbf": "phpcbf --standard=phpcs.xml .", 29 "phpcs": "phpcs --standard=phpcs.xml .", 27 30 "phplint": "phplint", 28 31 "psalm": "psalm --no-cache" -
smntcs-simple-events-widget/tags/2.5/composer.lock
r3260220 r3490507 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " 2b427520ede5ee7ebf10233fd6287850",7 "content-hash": "840ab54c03a0249cf4e53c3ee64886b4", 8 8 "packages": [], 9 9 "packages-dev": [ … … 581 581 { 582 582 "name": "doctrine/deprecations", 583 "version": "1.1. 4",583 "version": "1.1.5", 584 584 "source": { 585 585 "type": "git", 586 586 "url": "https://github.com/doctrine/deprecations.git", 587 "reference": " 31610dbb31faa98e6b5447b62340826f54fbc4e9"588 }, 589 "dist": { 590 "type": "zip", 591 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/ 31610dbb31faa98e6b5447b62340826f54fbc4e9",592 "reference": " 31610dbb31faa98e6b5447b62340826f54fbc4e9",587 "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" 588 }, 589 "dist": { 590 "type": "zip", 591 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", 592 "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", 593 593 "shasum": "" 594 594 }, … … 596 596 "php": "^7.1 || ^8.0" 597 597 }, 598 "require-dev": { 599 "doctrine/coding-standard": "^9 || ^12", 600 "phpstan/phpstan": "1.4.10 || 2.0.3", 598 "conflict": { 599 "phpunit/phpunit": "<=7.5 || >=13" 600 }, 601 "require-dev": { 602 "doctrine/coding-standard": "^9 || ^12 || ^13", 603 "phpstan/phpstan": "1.4.10 || 2.1.11", 601 604 "phpstan/phpstan-phpunit": "^1.0 || ^2", 602 "phpunit/phpunit": "^7.5 || ^8.5 || ^9. 5",605 "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", 603 606 "psr/log": "^1 || ^2 || ^3" 604 607 }, … … 620 623 "support": { 621 624 "issues": "https://github.com/doctrine/deprecations/issues", 622 "source": "https://github.com/doctrine/deprecations/tree/1.1. 4"623 }, 624 "time": "202 4-12-07T21:18:45+00:00"625 "source": "https://github.com/doctrine/deprecations/tree/1.1.5" 626 }, 627 "time": "2025-04-07T20:06:18+00:00" 625 628 }, 626 629 { … … 1095 1098 { 1096 1099 "name": "php-stubs/wordpress-stubs", 1097 "version": "v6. 7.2",1100 "version": "v6.8.1", 1098 1101 "source": { 1099 1102 "type": "git", 1100 1103 "url": "https://github.com/php-stubs/wordpress-stubs.git", 1101 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4" 1102 }, 1103 "dist": { 1104 "type": "zip", 1105 "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/c04f96cb232fab12a3cbcccf5a47767f0665c3f4", 1106 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4", 1107 "shasum": "" 1104 "reference": "92e444847d94f7c30f88c60004648f507688acd5" 1105 }, 1106 "dist": { 1107 "type": "zip", 1108 "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/92e444847d94f7c30f88c60004648f507688acd5", 1109 "reference": "92e444847d94f7c30f88c60004648f507688acd5", 1110 "shasum": "" 1111 }, 1112 "conflict": { 1113 "phpdocumentor/reflection-docblock": "5.6.1" 1108 1114 }, 1109 1115 "require-dev": { 1110 1116 "dealerdirect/phpcodesniffer-composer-installer": "^1.0", 1111 "nikic/php-parser": "^ 4.13",1117 "nikic/php-parser": "^5.4", 1112 1118 "php": "^7.4 || ^8.0", 1113 1119 "php-stubs/generator": "^0.8.3", 1114 1120 "phpdocumentor/reflection-docblock": "^5.4.1", 1115 "phpstan/phpstan": "^ 1.11",1121 "phpstan/phpstan": "^2.1", 1116 1122 "phpunit/phpunit": "^9.5", 1117 1123 "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.1.1", … … 1137 1143 "support": { 1138 1144 "issues": "https://github.com/php-stubs/wordpress-stubs/issues", 1139 "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6. 7.2"1140 }, 1141 "time": "2025-0 2-12T04:51:58+00:00"1145 "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.8.1" 1146 }, 1147 "time": "2025-05-02T12:33:34+00:00" 1142 1148 }, 1143 1149 { … … 1390 1396 }, 1391 1397 { 1398 "name": "phpcsstandards/phpcsextra", 1399 "version": "1.3.0", 1400 "source": { 1401 "type": "git", 1402 "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", 1403 "reference": "46d08eb86eec622b96c466adec3063adfed280dd" 1404 }, 1405 "dist": { 1406 "type": "zip", 1407 "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/46d08eb86eec622b96c466adec3063adfed280dd", 1408 "reference": "46d08eb86eec622b96c466adec3063adfed280dd", 1409 "shasum": "" 1410 }, 1411 "require": { 1412 "php": ">=5.4", 1413 "phpcsstandards/phpcsutils": "^1.0.9", 1414 "squizlabs/php_codesniffer": "^3.12.1" 1415 }, 1416 "require-dev": { 1417 "php-parallel-lint/php-console-highlighter": "^1.0", 1418 "php-parallel-lint/php-parallel-lint": "^1.3.2", 1419 "phpcsstandards/phpcsdevcs": "^1.1.6", 1420 "phpcsstandards/phpcsdevtools": "^1.2.1", 1421 "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" 1422 }, 1423 "type": "phpcodesniffer-standard", 1424 "extra": { 1425 "branch-alias": { 1426 "dev-stable": "1.x-dev", 1427 "dev-develop": "1.x-dev" 1428 } 1429 }, 1430 "notification-url": "https://packagist.org/downloads/", 1431 "license": [ 1432 "LGPL-3.0-or-later" 1433 ], 1434 "authors": [ 1435 { 1436 "name": "Juliette Reinders Folmer", 1437 "homepage": "https://github.com/jrfnl", 1438 "role": "lead" 1439 }, 1440 { 1441 "name": "Contributors", 1442 "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" 1443 } 1444 ], 1445 "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", 1446 "keywords": [ 1447 "PHP_CodeSniffer", 1448 "phpcbf", 1449 "phpcodesniffer-standard", 1450 "phpcs", 1451 "standards", 1452 "static analysis" 1453 ], 1454 "support": { 1455 "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", 1456 "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", 1457 "source": "https://github.com/PHPCSStandards/PHPCSExtra" 1458 }, 1459 "funding": [ 1460 { 1461 "url": "https://github.com/PHPCSStandards", 1462 "type": "github" 1463 }, 1464 { 1465 "url": "https://github.com/jrfnl", 1466 "type": "github" 1467 }, 1468 { 1469 "url": "https://opencollective.com/php_codesniffer", 1470 "type": "open_collective" 1471 }, 1472 { 1473 "url": "https://thanks.dev/u/gh/phpcsstandards", 1474 "type": "thanks_dev" 1475 } 1476 ], 1477 "time": "2025-04-20T23:35:32+00:00" 1478 }, 1479 { 1480 "name": "phpcsstandards/phpcsutils", 1481 "version": "1.0.12", 1482 "source": { 1483 "type": "git", 1484 "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", 1485 "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" 1486 }, 1487 "dist": { 1488 "type": "zip", 1489 "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", 1490 "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", 1491 "shasum": "" 1492 }, 1493 "require": { 1494 "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", 1495 "php": ">=5.4", 1496 "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" 1497 }, 1498 "require-dev": { 1499 "ext-filter": "*", 1500 "php-parallel-lint/php-console-highlighter": "^1.0", 1501 "php-parallel-lint/php-parallel-lint": "^1.3.2", 1502 "phpcsstandards/phpcsdevcs": "^1.1.6", 1503 "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" 1504 }, 1505 "type": "phpcodesniffer-standard", 1506 "extra": { 1507 "branch-alias": { 1508 "dev-stable": "1.x-dev", 1509 "dev-develop": "1.x-dev" 1510 } 1511 }, 1512 "autoload": { 1513 "classmap": [ 1514 "PHPCSUtils/" 1515 ] 1516 }, 1517 "notification-url": "https://packagist.org/downloads/", 1518 "license": [ 1519 "LGPL-3.0-or-later" 1520 ], 1521 "authors": [ 1522 { 1523 "name": "Juliette Reinders Folmer", 1524 "homepage": "https://github.com/jrfnl", 1525 "role": "lead" 1526 }, 1527 { 1528 "name": "Contributors", 1529 "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" 1530 } 1531 ], 1532 "description": "A suite of utility functions for use with PHP_CodeSniffer", 1533 "homepage": "https://phpcsutils.com/", 1534 "keywords": [ 1535 "PHP_CodeSniffer", 1536 "phpcbf", 1537 "phpcodesniffer-standard", 1538 "phpcs", 1539 "phpcs3", 1540 "standards", 1541 "static analysis", 1542 "tokens", 1543 "utility" 1544 ], 1545 "support": { 1546 "docs": "https://phpcsutils.com/", 1547 "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", 1548 "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", 1549 "source": "https://github.com/PHPCSStandards/PHPCSUtils" 1550 }, 1551 "funding": [ 1552 { 1553 "url": "https://github.com/PHPCSStandards", 1554 "type": "github" 1555 }, 1556 { 1557 "url": "https://github.com/jrfnl", 1558 "type": "github" 1559 }, 1560 { 1561 "url": "https://opencollective.com/php_codesniffer", 1562 "type": "open_collective" 1563 } 1564 ], 1565 "time": "2024-05-20T13:34:27+00:00" 1566 }, 1567 { 1392 1568 "name": "phpdocumentor/reflection-common", 1393 1569 "version": "2.2.0", … … 1444 1620 { 1445 1621 "name": "phpdocumentor/reflection-docblock", 1446 "version": "5.6. 1",1622 "version": "5.6.2", 1447 1623 "source": { 1448 1624 "type": "git", 1449 1625 "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 1450 "reference": " e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"1451 }, 1452 "dist": { 1453 "type": "zip", 1454 "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/ e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",1455 "reference": " e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",1626 "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" 1627 }, 1628 "dist": { 1629 "type": "zip", 1630 "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", 1631 "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", 1456 1632 "shasum": "" 1457 1633 }, … … 1502 1678 "support": { 1503 1679 "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", 1504 "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6. 1"1505 }, 1506 "time": "202 4-12-07T09:39:29+00:00"1680 "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" 1681 }, 1682 "time": "2025-04-13T19:20:35+00:00" 1507 1683 }, 1508 1684 { … … 1782 1958 { 1783 1959 "name": "squizlabs/php_codesniffer", 1784 "version": "3.12. 0",1960 "version": "3.12.2", 1785 1961 "source": { 1786 1962 "type": "git", 1787 1963 "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", 1788 "reference": " 2d1b63db139c3c6ea0c927698e5160f8b3b8d630"1789 }, 1790 "dist": { 1791 "type": "zip", 1792 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ 2d1b63db139c3c6ea0c927698e5160f8b3b8d630",1793 "reference": " 2d1b63db139c3c6ea0c927698e5160f8b3b8d630",1964 "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa" 1965 }, 1966 "dist": { 1967 "type": "zip", 1968 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa", 1969 "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa", 1794 1970 "shasum": "" 1795 1971 }, … … 1862 2038 } 1863 2039 ], 1864 "time": "2025-0 3-18T05:04:51+00:00"2040 "time": "2025-04-13T04:10:18+00:00" 1865 2041 }, 1866 2042 { … … 2095 2271 { 2096 2272 "name": "symfony/polyfill-ctype", 2097 "version": "v1.3 1.0",2273 "version": "v1.32.0", 2098 2274 "source": { 2099 2275 "type": "git", … … 2154 2330 ], 2155 2331 "support": { 2156 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.3 1.0"2332 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" 2157 2333 }, 2158 2334 "funding": [ … … 2174 2350 { 2175 2351 "name": "symfony/polyfill-intl-grapheme", 2176 "version": "v1.3 1.0",2352 "version": "v1.32.0", 2177 2353 "source": { 2178 2354 "type": "git", … … 2232 2408 ], 2233 2409 "support": { 2234 "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.3 1.0"2410 "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" 2235 2411 }, 2236 2412 "funding": [ … … 2252 2428 { 2253 2429 "name": "symfony/polyfill-intl-normalizer", 2254 "version": "v1.3 1.0",2430 "version": "v1.32.0", 2255 2431 "source": { 2256 2432 "type": "git", … … 2313 2489 ], 2314 2490 "support": { 2315 "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.3 1.0"2491 "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" 2316 2492 }, 2317 2493 "funding": [ … … 2333 2509 { 2334 2510 "name": "symfony/polyfill-mbstring", 2335 "version": "v1.3 1.0",2511 "version": "v1.32.0", 2336 2512 "source": { 2337 2513 "type": "git", 2338 2514 "url": "https://github.com/symfony/polyfill-mbstring.git", 2339 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" 2340 }, 2341 "dist": { 2342 "type": "zip", 2343 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", 2344 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", 2345 "shasum": "" 2346 }, 2347 "require": { 2515 "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" 2516 }, 2517 "dist": { 2518 "type": "zip", 2519 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", 2520 "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", 2521 "shasum": "" 2522 }, 2523 "require": { 2524 "ext-iconv": "*", 2348 2525 "php": ">=7.2" 2349 2526 }, … … 2393 2570 ], 2394 2571 "support": { 2395 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.3 1.0"2572 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" 2396 2573 }, 2397 2574 "funding": [ … … 2409 2586 } 2410 2587 ], 2411 "time": "2024- 09-09T11:45:10+00:00"2588 "time": "2024-12-23T08:48:59+00:00" 2412 2589 }, 2413 2590 { 2414 2591 "name": "symfony/polyfill-php73", 2415 "version": "v1.3 1.0",2592 "version": "v1.32.0", 2416 2593 "source": { 2417 2594 "type": "git", … … 2469 2646 ], 2470 2647 "support": { 2471 "source": "https://github.com/symfony/polyfill-php73/tree/v1.3 1.0"2648 "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" 2472 2649 }, 2473 2650 "funding": [ … … 2489 2666 { 2490 2667 "name": "symfony/polyfill-php80", 2491 "version": "v1.3 1.0",2668 "version": "v1.32.0", 2492 2669 "source": { 2493 2670 "type": "git", 2494 2671 "url": "https://github.com/symfony/polyfill-php80.git", 2495 "reference": " 60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"2496 }, 2497 "dist": { 2498 "type": "zip", 2499 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/ 60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",2500 "reference": " 60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",2672 "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" 2673 }, 2674 "dist": { 2675 "type": "zip", 2676 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", 2677 "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", 2501 2678 "shasum": "" 2502 2679 }, … … 2549 2726 ], 2550 2727 "support": { 2551 "source": "https://github.com/symfony/polyfill-php80/tree/v1.3 1.0"2728 "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" 2552 2729 }, 2553 2730 "funding": [ … … 2565 2742 } 2566 2743 ], 2567 "time": "202 4-09-09T11:45:10+00:00"2744 "time": "2025-01-02T08:10:11+00:00" 2568 2745 }, 2569 2746 { … … 2714 2891 { 2715 2892 "name": "symfony/string", 2716 "version": "v6.4. 15",2893 "version": "v6.4.21", 2717 2894 "source": { 2718 2895 "type": "git", 2719 2896 "url": "https://github.com/symfony/string.git", 2720 "reference": "73 a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f"2721 }, 2722 "dist": { 2723 "type": "zip", 2724 "url": "https://api.github.com/repos/symfony/string/zipball/73 a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",2725 "reference": "73 a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",2897 "reference": "73e2c6966a5aef1d4892873ed5322245295370c6" 2898 }, 2899 "dist": { 2900 "type": "zip", 2901 "url": "https://api.github.com/repos/symfony/string/zipball/73e2c6966a5aef1d4892873ed5322245295370c6", 2902 "reference": "73e2c6966a5aef1d4892873ed5322245295370c6", 2726 2903 "shasum": "" 2727 2904 }, … … 2780 2957 ], 2781 2958 "support": { 2782 "source": "https://github.com/symfony/string/tree/v6.4. 15"2959 "source": "https://github.com/symfony/string/tree/v6.4.21" 2783 2960 }, 2784 2961 "funding": [ … … 2796 2973 } 2797 2974 ], 2798 "time": "202 4-11-13T13:31:12+00:00"2975 "time": "2025-04-18T15:23:29+00:00" 2799 2976 }, 2800 2977 { … … 3092 3269 { 3093 3270 "name": "wp-coding-standards/wpcs", 3094 "version": " 2.3.0",3271 "version": "3.1.0", 3095 3272 "source": { 3096 3273 "type": "git", 3097 3274 "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 3098 "reference": "7da1894633f168fe244afc6de00d141f27517b62" 3099 }, 3100 "dist": { 3101 "type": "zip", 3102 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", 3103 "reference": "7da1894633f168fe244afc6de00d141f27517b62", 3104 "shasum": "" 3105 }, 3106 "require": { 3275 "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" 3276 }, 3277 "dist": { 3278 "type": "zip", 3279 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", 3280 "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", 3281 "shasum": "" 3282 }, 3283 "require": { 3284 "ext-filter": "*", 3285 "ext-libxml": "*", 3286 "ext-tokenizer": "*", 3287 "ext-xmlreader": "*", 3107 3288 "php": ">=5.4", 3108 "squizlabs/php_codesniffer": "^3.3.1" 3109 }, 3110 "require-dev": { 3111 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", 3289 "phpcsstandards/phpcsextra": "^1.2.1", 3290 "phpcsstandards/phpcsutils": "^1.0.10", 3291 "squizlabs/php_codesniffer": "^3.9.0" 3292 }, 3293 "require-dev": { 3294 "php-parallel-lint/php-console-highlighter": "^1.0.0", 3295 "php-parallel-lint/php-parallel-lint": "^1.3.2", 3112 3296 "phpcompatibility/php-compatibility": "^9.0", 3113 "phpcsstandards/phpcsdevtools": "^1. 0",3114 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 "3297 "phpcsstandards/phpcsdevtools": "^1.2.0", 3298 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" 3115 3299 }, 3116 3300 "suggest": { 3117 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 3301 "ext-iconv": "For improved results", 3302 "ext-mbstring": "For improved results" 3118 3303 }, 3119 3304 "type": "phpcodesniffer-standard", … … 3132 3317 "phpcs", 3133 3318 "standards", 3319 "static analysis", 3134 3320 "wordpress" 3135 3321 ], … … 3139 3325 "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" 3140 3326 }, 3141 "time": "2020-05-13T23:57:56+00:00" 3327 "funding": [ 3328 { 3329 "url": "https://opencollective.com/php_codesniffer", 3330 "type": "custom" 3331 } 3332 ], 3333 "time": "2024-03-25T16:39:00+00:00" 3142 3334 }, 3143 3335 { 3144 3336 "name": "wp-hooks/wordpress-core", 3145 "version": "1. 9.0",3337 "version": "1.10.0", 3146 3338 "source": { 3147 3339 "type": "git", 3148 3340 "url": "https://github.com/wp-hooks/wordpress-core-hooks.git", 3149 "reference": " 8cc9adaf9a87670ac434d440eb66d06d65ec215c"3150 }, 3151 "dist": { 3152 "type": "zip", 3153 "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/ 8cc9adaf9a87670ac434d440eb66d06d65ec215c",3154 "reference": " 8cc9adaf9a87670ac434d440eb66d06d65ec215c",3341 "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148" 3342 }, 3343 "dist": { 3344 "type": "zip", 3345 "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/127af21a918a52bcead7ce9b743b17b5d64eb148", 3346 "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148", 3155 3347 "shasum": "" 3156 3348 }, … … 3162 3354 "oomphinc/composer-installers-extender": "^2", 3163 3355 "roots/wordpress-core-installer": "^1.0.0", 3164 "roots/wordpress-full": "6. 7",3356 "roots/wordpress-full": "6.8", 3165 3357 "wp-hooks/generator": "1.0.0" 3166 3358 }, … … 3213 3405 "support": { 3214 3406 "issues": "https://github.com/wp-hooks/wordpress-core-hooks/issues", 3215 "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1. 9.0"3407 "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1.10.0" 3216 3408 }, 3217 3409 "funding": [ … … 3221 3413 } 3222 3414 ], 3223 "time": "202 4-12-04T23:00:43+00:00"3415 "time": "2025-04-16T22:20:41+00:00" 3224 3416 } 3225 3417 ], … … 3229 3421 "prefer-stable": false, 3230 3422 "prefer-lowest": false, 3231 "platform": { 3232 "php": ">=7.0" 3233 }, 3423 "platform": {}, 3234 3424 "platform-dev": {}, 3235 3425 "plugin-api-version": "2.6.0" -
smntcs-simple-events-widget/tags/2.5/includes/class-smntcs-simple-events-widget.php
r3260220 r3490507 19 19 */ 20 20 public function __construct() { 21 $widget_options = array(21 $widget_options = [ 22 22 'classname' => 'smntcs_simple_events_widget', 23 23 'description' => 'Display Simple Events Widget', 24 );24 ]; 25 25 parent::__construct( 'smntcs_simple_events_widget', 'Simple Events Widget', $widget_options ); 26 26 } … … 33 33 */ 34 34 public function widget( $args, $instance ) { 35 $title = apply_filters( 'widget_title', $instance['title'] ); 36 $timestamp = current_time( 'timestamp' ); 35 $title = apply_filters( 'widget_title', $instance['title'] ); 36 // Event meta is stored as UTC Unix timestamps; compare using the current instant. 37 $timestamp = time(); 38 39 $sort_order = isset( $instance['sort_order'] ) && 'DESC' === $instance['sort_order'] ? 'DESC' : 'ASC'; 37 40 38 41 echo wp_kses_post( $args['before_widget'] ); … … 41 44 } 42 45 43 $query_args = array( 44 'post_type' => array( 'post', 'page' ), 45 'meta_key' => 'datepicker_start', 46 'orderby' => 'meta_value', 47 'order' => 'DESC', 48 ); 46 $query_args = [ 47 'post_type' => [ 'post', 'page', 'product' ], 48 'meta_key' => 'datepicker_start', 49 'orderby' => 'meta_value', 50 'order' => $sort_order, 51 'meta_type' => 'NUMERIC', 52 'posts_per_page' => -1, 53 ]; 49 54 50 55 if ( 'upcoming-events' === $instance['display_events'] ) { 51 $query_args['meta_query'] = array(52 array(56 $query_args['meta_query'] = [ 57 [ 53 58 'key' => 'datepicker_start', 54 59 'value' => $timestamp, 55 60 'compare' => '>=', 56 61 'type' => 'NUMERIC', 57 ),58 );62 ], 63 ]; 59 64 } 60 65 61 66 if ( 'previous-events' === $instance['display_events'] ) { 62 $query_args['meta_query'] = array(63 array(67 $query_args['meta_query'] = [ 68 [ 64 69 'key' => 'datepicker_start', 65 70 'value' => $timestamp, 66 71 'compare' => '<', 67 72 'type' => 'NUMERIC', 68 ),69 );73 ], 74 ]; 70 75 } 71 76 72 77 $the_query = new WP_Query( $query_args ); 78 79 $date_title_separator = ! empty( $instance['date_title_line_break'] ) ? ': <br />' : ': '; 73 80 74 81 if ( $the_query->have_posts() ) { … … 77 84 $the_query->the_post(); 78 85 $start_date_meta = get_post_meta( get_the_ID(), 'datepicker_start', true ); 79 $start_date = $start_date_meta ? gmdate( get_option( 'date_format' ), intval( $start_date_meta )) : __( 'No start date', 'smntcs-simple-events-widget' );86 $start_date = $start_date_meta ? date_i18n( get_option( 'date_format' ), intval( $start_date_meta ), true ) : __( 'No start date', 'smntcs-simple-events-widget' ); 80 87 $end_date_meta = get_post_meta( get_the_ID(), 'datepicker_end', true ); 81 $end_date = $end_date_meta ? gmdate( get_option( 'date_format' ), intval( $end_date_meta ) ) : __( 'No end date', 'smntcs-simple-events-widget' ); 82 83 $link = get_permalink(); 88 $end_date = $end_date_meta ? date_i18n( get_option( 'date_format' ), intval( $end_date_meta ), true ) : __( 'No end date', 'smntcs-simple-events-widget' ); 89 $link = get_permalink(); 84 90 85 91 if ( 'start-and-end-date' === $instance['display_dates'] ) { 86 92 printf( 87 '<li>%s - %s :<br><a href="%s">%s</a><br><br></li>',93 '<li>%s - %s%s<a href="%s">%s</a></li>', 88 94 esc_html( $start_date ), 89 95 esc_html( $end_date ), 96 wp_kses_post( $date_title_separator ), 90 97 esc_url( $link ), 91 98 esc_html( get_the_title() ) … … 93 100 } else { 94 101 printf( 95 '<li>%s :<br><a href="%s">%s</a><br><br></li>',102 '<li>%s%s<a href="%s">%s</a></li>', 96 103 esc_html( $start_date ), 104 wp_kses_post( $date_title_separator ), 97 105 esc_url( $link ), 98 106 esc_html( get_the_title() ) … … 139 147 </select> 140 148 </p> 149 <p> 150 <label for="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>"><?php esc_html_e( 'Sort order:', 'smntcs-simple-events-widget' ); ?></label> 151 <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'sort_order' ) ); ?>"> 152 <option <?php selected( $instance['sort_order'] ?? 'ASC', 'ASC' ); ?> value="ASC"><?php esc_html_e( 'Ascending (earliest first)', 'smntcs-simple-events-widget' ); ?></option> 153 <option <?php selected( $instance['sort_order'] ?? 'ASC', 'DESC' ); ?> value="DESC"><?php esc_html_e( 'Descending (latest first)', 'smntcs-simple-events-widget' ); ?></option> 154 </select> 155 </p> 156 <p> 157 <input class="checkbox" type="checkbox" <?php checked( ! empty( $instance['date_title_line_break'] ) ); ?> id="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'date_title_line_break' ) ); ?>" value="1"> 158 <label for="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>"><?php esc_html_e( 'Line break between date and title', 'smntcs-simple-events-widget' ); ?></label> 159 </p> 141 160 <?php 142 161 } … … 153 172 $instance = $old_instance; 154 173 155 $instance['title'] = strip_tags( $new_instance['title'] ); 156 $instance['display_events'] = strip_tags( $new_instance['display_events'] ); 157 $instance['display_dates'] = strip_tags( $new_instance['display_dates'] ); 174 $instance['title'] = wp_strip_all_tags( $new_instance['title'] ); 175 $instance['display_events'] = wp_strip_all_tags( $new_instance['display_events'] ); 176 $instance['display_dates'] = wp_strip_all_tags( $new_instance['display_dates'] ); 177 178 $raw_sort = isset( $new_instance['sort_order'] ) ? strtoupper( wp_strip_all_tags( $new_instance['sort_order'] ) ) : 'ASC'; 179 $instance['sort_order'] = ( 'DESC' === $raw_sort ) ? 'DESC' : 'ASC'; 180 $instance['date_title_line_break'] = ! empty( $new_instance['date_title_line_break'] ) ? '1' : ''; 158 181 159 182 return $instance; -
smntcs-simple-events-widget/tags/2.5/includes/class-smntcs-simple-events.php
r2994698 r3490507 19 19 */ 20 20 public function __construct() { 21 add_action( 'plugins_loaded', array( $this, 'load_textdomain' ));22 add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), array( $this, 'plugin_settings_link' ));23 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ));24 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ));25 add_action( 'save_post', array( $this, 'save_post' ));26 add_action( 'widgets_init', array( $this, 'widgets_init' ));21 add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] ); 22 add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), [ $this, 'plugin_settings_link' ] ); 23 add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] ); 24 add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] ); 25 add_action( 'save_post', [ $this, 'save_post' ] ); 26 add_action( 'widgets_init', [ $this, 'widgets_init' ] ); 27 27 } 28 28 … … 57 57 $plugin_data = get_plugin_data( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ); 58 58 wp_enqueue_script( 'jquery-ui-datepicker' ); 59 wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', array( 'jquery' ), $plugin_data['Version']);60 wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', array(), $plugin_data['Version'] );59 wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', [ 'jquery' ], $plugin_data['Version'], true ); 60 wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', [], $plugin_data['Version'] ); 61 61 } 62 62 … … 67 67 */ 68 68 public function add_meta_boxes() { 69 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'post', 'side' ); 70 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'page', 'side' ); 69 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'post', 'side' ); 70 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'page', 'side' ); 71 72 // Add meta box for WooCommerce products if WooCommerce is active. 73 if ( class_exists( 'WooCommerce' ) ) { 74 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'product', 'side' ); 75 } 71 76 } 72 77 … … 108 113 // Check for nonce. 109 114 if ( ! isset( $_POST['smntcs_wpnonce'] ) || 110 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) {115 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) { 111 116 return; 112 117 } … … 165 170 */ 166 171 public static function timestamp_to_date( $timestamp ) { 167 return gmdate( 'd-m-Y', $timestamp );172 return date_i18n( get_option( 'date_format' ), $timestamp ); 168 173 } 169 174 } -
smntcs-simple-events-widget/tags/2.5/smntcs-simple-events-widget.php
r3260220 r3490507 3 3 * Plugin Name: SMNTCS Simple Events Widget 4 4 * Plugin URI: https://github.com/nielslange/smntcs-simple-events-widget 5 * Description: Add meta box to posts and pages, to select event start and end date and show upcoming and previous events assidebar widget.5 * Description: Add event start and optional end dates on posts, pages, and WooCommerce products; list them in a customizable sidebar widget. 6 6 * Author: Niels Lange 7 7 * Author URI: https://nielslange.de 8 8 * Text Domain: smntcs-simple-events-widget 9 * Version: 2. 49 * Version: 2.5 10 10 * Requires PHP: 7.4 11 11 * Requires at least: 3.4 -
smntcs-simple-events-widget/trunk/README.md
r3260220 r3490507 10 10  11 11 12 Sidebar widget to show (upcoming and previous) events. 12 Add event dates to your content and list upcoming or past events in a classic sidebar widget. 13 14 **SMNTCS Simple Events Widget** is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site. 15 16 You pick a start date and, if you want, an end date, right in the editor. Then you drop the **Simple Events Widget** into a widget area and choose whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates follow your site’s language and date format. 17 18 - Event fields (with date picker) on posts, pages, and on products when WooCommerce is active 19 - Widget: upcoming events, previous events, or both 20 - Display start date only or start and end date 21 - Sort order and optional line break between date and title 22 - Classic WordPress widget—use **Customize → Widgets** or your theme’s widget regions 13 23 14 24 ## Installation … … 19 29 4. If wanted, also provide an end date of the event. 20 30 5. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar. 21 6. Adjust the widget settings according to you needs.31 6. Adjust the widget settings according to your needs. 22 32 23 33 ## Plugin page … … 26 36 27 37 ## Changelog 38 39 ### 2.5 (2025.03.25) 40 41 - Tested up to WordPress 6.9 42 - Add widget options for event sort order and line break between date and title 43 - Use date_i18n for localized date output 44 - Include WooCommerce products when querying events 45 - Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions 28 46 29 47 ### 2.4 (2025.03.23) -
smntcs-simple-events-widget/trunk/README.txt
r3260220 r3490507 3 3 Contributors: nielslange 4 4 Tags: Simple Events, Event, Widget, Sidebar 5 Stable tag: 2. 46 Tested up to: 6. 85 Stable tag: 2.5 6 Tested up to: 6.9 7 7 Requires at least: 3.4 8 8 Requires PHP: 7.4 … … 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Sidebar widget to show (upcoming and previous) events.12 Add event dates to your content and list upcoming or past events in a classic sidebar widget. 13 13 14 14 == Description == 15 15 16 Sidebar widget to show (upcoming and previous) events. 16 SMNTCS Simple Events Widget is a lightweight way to pin calendar dates to individual posts, pages, or WooCommerce products and show them in the sidebar when visitors browse your site. 17 18 You pick a start date and, if you want, an end date, right in the editor. Then you drop the *Simple Events Widget* into a widget area and decide whether to show what is still ahead, what has already passed, or both. You can show only the start date or start and end together, change the sort order, add a line break before the title, and dates respect your site’s language and date format. 19 20 * Event fields (with date picker) on posts, pages, and on products when WooCommerce is active 21 * Widget: upcoming events, previous events, or both 22 * Display start date only or start and end date 23 * Sort order and optional line break between date and title 24 * Classic WordPress widget—place it under **Customize → Widgets** or in your theme’s widget regions 17 25 18 26 == Installation == … … 23 31 4. If wanted, also provide an end date of the event. 24 32 5. Go to `Customize » Widgets`, add the `Simple Events Widget` to the required sidebar. 25 6. Adjust the widget settings according to you needs.33 6. Adjust the widget settings according to your needs. 26 34 27 35 == Screenshots == … … 32 40 33 41 == Changelog == 42 43 = 2.5 (2025.03.25) = 44 45 - Tested up to WordPress 6.9 46 - Add widget options for event sort order and line break between date and title 47 - Use date_i18n for localized date output 48 - Include WooCommerce products when querying events 49 - Update Composer dev dependencies; replace phpcs.dist.xml with phpcs.xml; refresh GitHub Actions 34 50 35 51 = 2.4 (2025.03.23) -
smntcs-simple-events-widget/trunk/composer.json
r2651293 r3490507 4 4 "homepage": "https://wordpress.org/plugins/smntcs-simple-events-widget/", 5 5 "type": "wordpress-plugin", 6 "keywords": [ 7 "WordPress", 8 "Plugin", 9 "SMNTCS Simple Events Widget" 10 ], 11 "license": "GPL-2.0-or-later", 6 12 "authors": [ 7 13 { … … 10 16 } 11 17 ], 12 "require": {13 "php": ">=7.0"14 },15 18 "require-dev": { 16 19 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", … … 18 21 "overtrue/phplint": "^2.3", 19 22 "phpcompatibility/phpcompatibility-wp": "^2.1", 20 "squizlabs/php_codesniffer": "^3. 6",23 "squizlabs/php_codesniffer": "^3.12", 21 24 "vimeo/psalm": "^4.7", 22 "wp-coding-standards/wpcs": "^ 2.3"25 "wp-coding-standards/wpcs": "^3.1" 23 26 }, 24 27 "scripts": { 25 "phpcbf": "phpcbf --standard=phpcs. dist.xml .",26 "phpcs": "phpcs --standard=phpcs. dist.xml .",28 "phpcbf": "phpcbf --standard=phpcs.xml .", 29 "phpcs": "phpcs --standard=phpcs.xml .", 27 30 "phplint": "phplint", 28 31 "psalm": "psalm --no-cache" -
smntcs-simple-events-widget/trunk/composer.lock
r3260220 r3490507 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " 2b427520ede5ee7ebf10233fd6287850",7 "content-hash": "840ab54c03a0249cf4e53c3ee64886b4", 8 8 "packages": [], 9 9 "packages-dev": [ … … 581 581 { 582 582 "name": "doctrine/deprecations", 583 "version": "1.1. 4",583 "version": "1.1.5", 584 584 "source": { 585 585 "type": "git", 586 586 "url": "https://github.com/doctrine/deprecations.git", 587 "reference": " 31610dbb31faa98e6b5447b62340826f54fbc4e9"588 }, 589 "dist": { 590 "type": "zip", 591 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/ 31610dbb31faa98e6b5447b62340826f54fbc4e9",592 "reference": " 31610dbb31faa98e6b5447b62340826f54fbc4e9",587 "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" 588 }, 589 "dist": { 590 "type": "zip", 591 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", 592 "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", 593 593 "shasum": "" 594 594 }, … … 596 596 "php": "^7.1 || ^8.0" 597 597 }, 598 "require-dev": { 599 "doctrine/coding-standard": "^9 || ^12", 600 "phpstan/phpstan": "1.4.10 || 2.0.3", 598 "conflict": { 599 "phpunit/phpunit": "<=7.5 || >=13" 600 }, 601 "require-dev": { 602 "doctrine/coding-standard": "^9 || ^12 || ^13", 603 "phpstan/phpstan": "1.4.10 || 2.1.11", 601 604 "phpstan/phpstan-phpunit": "^1.0 || ^2", 602 "phpunit/phpunit": "^7.5 || ^8.5 || ^9. 5",605 "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", 603 606 "psr/log": "^1 || ^2 || ^3" 604 607 }, … … 620 623 "support": { 621 624 "issues": "https://github.com/doctrine/deprecations/issues", 622 "source": "https://github.com/doctrine/deprecations/tree/1.1. 4"623 }, 624 "time": "202 4-12-07T21:18:45+00:00"625 "source": "https://github.com/doctrine/deprecations/tree/1.1.5" 626 }, 627 "time": "2025-04-07T20:06:18+00:00" 625 628 }, 626 629 { … … 1095 1098 { 1096 1099 "name": "php-stubs/wordpress-stubs", 1097 "version": "v6. 7.2",1100 "version": "v6.8.1", 1098 1101 "source": { 1099 1102 "type": "git", 1100 1103 "url": "https://github.com/php-stubs/wordpress-stubs.git", 1101 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4" 1102 }, 1103 "dist": { 1104 "type": "zip", 1105 "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/c04f96cb232fab12a3cbcccf5a47767f0665c3f4", 1106 "reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4", 1107 "shasum": "" 1104 "reference": "92e444847d94f7c30f88c60004648f507688acd5" 1105 }, 1106 "dist": { 1107 "type": "zip", 1108 "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/92e444847d94f7c30f88c60004648f507688acd5", 1109 "reference": "92e444847d94f7c30f88c60004648f507688acd5", 1110 "shasum": "" 1111 }, 1112 "conflict": { 1113 "phpdocumentor/reflection-docblock": "5.6.1" 1108 1114 }, 1109 1115 "require-dev": { 1110 1116 "dealerdirect/phpcodesniffer-composer-installer": "^1.0", 1111 "nikic/php-parser": "^ 4.13",1117 "nikic/php-parser": "^5.4", 1112 1118 "php": "^7.4 || ^8.0", 1113 1119 "php-stubs/generator": "^0.8.3", 1114 1120 "phpdocumentor/reflection-docblock": "^5.4.1", 1115 "phpstan/phpstan": "^ 1.11",1121 "phpstan/phpstan": "^2.1", 1116 1122 "phpunit/phpunit": "^9.5", 1117 1123 "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.1.1", … … 1137 1143 "support": { 1138 1144 "issues": "https://github.com/php-stubs/wordpress-stubs/issues", 1139 "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6. 7.2"1140 }, 1141 "time": "2025-0 2-12T04:51:58+00:00"1145 "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.8.1" 1146 }, 1147 "time": "2025-05-02T12:33:34+00:00" 1142 1148 }, 1143 1149 { … … 1390 1396 }, 1391 1397 { 1398 "name": "phpcsstandards/phpcsextra", 1399 "version": "1.3.0", 1400 "source": { 1401 "type": "git", 1402 "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", 1403 "reference": "46d08eb86eec622b96c466adec3063adfed280dd" 1404 }, 1405 "dist": { 1406 "type": "zip", 1407 "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/46d08eb86eec622b96c466adec3063adfed280dd", 1408 "reference": "46d08eb86eec622b96c466adec3063adfed280dd", 1409 "shasum": "" 1410 }, 1411 "require": { 1412 "php": ">=5.4", 1413 "phpcsstandards/phpcsutils": "^1.0.9", 1414 "squizlabs/php_codesniffer": "^3.12.1" 1415 }, 1416 "require-dev": { 1417 "php-parallel-lint/php-console-highlighter": "^1.0", 1418 "php-parallel-lint/php-parallel-lint": "^1.3.2", 1419 "phpcsstandards/phpcsdevcs": "^1.1.6", 1420 "phpcsstandards/phpcsdevtools": "^1.2.1", 1421 "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" 1422 }, 1423 "type": "phpcodesniffer-standard", 1424 "extra": { 1425 "branch-alias": { 1426 "dev-stable": "1.x-dev", 1427 "dev-develop": "1.x-dev" 1428 } 1429 }, 1430 "notification-url": "https://packagist.org/downloads/", 1431 "license": [ 1432 "LGPL-3.0-or-later" 1433 ], 1434 "authors": [ 1435 { 1436 "name": "Juliette Reinders Folmer", 1437 "homepage": "https://github.com/jrfnl", 1438 "role": "lead" 1439 }, 1440 { 1441 "name": "Contributors", 1442 "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" 1443 } 1444 ], 1445 "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", 1446 "keywords": [ 1447 "PHP_CodeSniffer", 1448 "phpcbf", 1449 "phpcodesniffer-standard", 1450 "phpcs", 1451 "standards", 1452 "static analysis" 1453 ], 1454 "support": { 1455 "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", 1456 "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", 1457 "source": "https://github.com/PHPCSStandards/PHPCSExtra" 1458 }, 1459 "funding": [ 1460 { 1461 "url": "https://github.com/PHPCSStandards", 1462 "type": "github" 1463 }, 1464 { 1465 "url": "https://github.com/jrfnl", 1466 "type": "github" 1467 }, 1468 { 1469 "url": "https://opencollective.com/php_codesniffer", 1470 "type": "open_collective" 1471 }, 1472 { 1473 "url": "https://thanks.dev/u/gh/phpcsstandards", 1474 "type": "thanks_dev" 1475 } 1476 ], 1477 "time": "2025-04-20T23:35:32+00:00" 1478 }, 1479 { 1480 "name": "phpcsstandards/phpcsutils", 1481 "version": "1.0.12", 1482 "source": { 1483 "type": "git", 1484 "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", 1485 "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" 1486 }, 1487 "dist": { 1488 "type": "zip", 1489 "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", 1490 "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", 1491 "shasum": "" 1492 }, 1493 "require": { 1494 "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", 1495 "php": ">=5.4", 1496 "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" 1497 }, 1498 "require-dev": { 1499 "ext-filter": "*", 1500 "php-parallel-lint/php-console-highlighter": "^1.0", 1501 "php-parallel-lint/php-parallel-lint": "^1.3.2", 1502 "phpcsstandards/phpcsdevcs": "^1.1.6", 1503 "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" 1504 }, 1505 "type": "phpcodesniffer-standard", 1506 "extra": { 1507 "branch-alias": { 1508 "dev-stable": "1.x-dev", 1509 "dev-develop": "1.x-dev" 1510 } 1511 }, 1512 "autoload": { 1513 "classmap": [ 1514 "PHPCSUtils/" 1515 ] 1516 }, 1517 "notification-url": "https://packagist.org/downloads/", 1518 "license": [ 1519 "LGPL-3.0-or-later" 1520 ], 1521 "authors": [ 1522 { 1523 "name": "Juliette Reinders Folmer", 1524 "homepage": "https://github.com/jrfnl", 1525 "role": "lead" 1526 }, 1527 { 1528 "name": "Contributors", 1529 "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" 1530 } 1531 ], 1532 "description": "A suite of utility functions for use with PHP_CodeSniffer", 1533 "homepage": "https://phpcsutils.com/", 1534 "keywords": [ 1535 "PHP_CodeSniffer", 1536 "phpcbf", 1537 "phpcodesniffer-standard", 1538 "phpcs", 1539 "phpcs3", 1540 "standards", 1541 "static analysis", 1542 "tokens", 1543 "utility" 1544 ], 1545 "support": { 1546 "docs": "https://phpcsutils.com/", 1547 "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", 1548 "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", 1549 "source": "https://github.com/PHPCSStandards/PHPCSUtils" 1550 }, 1551 "funding": [ 1552 { 1553 "url": "https://github.com/PHPCSStandards", 1554 "type": "github" 1555 }, 1556 { 1557 "url": "https://github.com/jrfnl", 1558 "type": "github" 1559 }, 1560 { 1561 "url": "https://opencollective.com/php_codesniffer", 1562 "type": "open_collective" 1563 } 1564 ], 1565 "time": "2024-05-20T13:34:27+00:00" 1566 }, 1567 { 1392 1568 "name": "phpdocumentor/reflection-common", 1393 1569 "version": "2.2.0", … … 1444 1620 { 1445 1621 "name": "phpdocumentor/reflection-docblock", 1446 "version": "5.6. 1",1622 "version": "5.6.2", 1447 1623 "source": { 1448 1624 "type": "git", 1449 1625 "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 1450 "reference": " e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"1451 }, 1452 "dist": { 1453 "type": "zip", 1454 "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/ e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",1455 "reference": " e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",1626 "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" 1627 }, 1628 "dist": { 1629 "type": "zip", 1630 "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", 1631 "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", 1456 1632 "shasum": "" 1457 1633 }, … … 1502 1678 "support": { 1503 1679 "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", 1504 "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6. 1"1505 }, 1506 "time": "202 4-12-07T09:39:29+00:00"1680 "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" 1681 }, 1682 "time": "2025-04-13T19:20:35+00:00" 1507 1683 }, 1508 1684 { … … 1782 1958 { 1783 1959 "name": "squizlabs/php_codesniffer", 1784 "version": "3.12. 0",1960 "version": "3.12.2", 1785 1961 "source": { 1786 1962 "type": "git", 1787 1963 "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", 1788 "reference": " 2d1b63db139c3c6ea0c927698e5160f8b3b8d630"1789 }, 1790 "dist": { 1791 "type": "zip", 1792 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ 2d1b63db139c3c6ea0c927698e5160f8b3b8d630",1793 "reference": " 2d1b63db139c3c6ea0c927698e5160f8b3b8d630",1964 "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa" 1965 }, 1966 "dist": { 1967 "type": "zip", 1968 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa", 1969 "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa", 1794 1970 "shasum": "" 1795 1971 }, … … 1862 2038 } 1863 2039 ], 1864 "time": "2025-0 3-18T05:04:51+00:00"2040 "time": "2025-04-13T04:10:18+00:00" 1865 2041 }, 1866 2042 { … … 2095 2271 { 2096 2272 "name": "symfony/polyfill-ctype", 2097 "version": "v1.3 1.0",2273 "version": "v1.32.0", 2098 2274 "source": { 2099 2275 "type": "git", … … 2154 2330 ], 2155 2331 "support": { 2156 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.3 1.0"2332 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" 2157 2333 }, 2158 2334 "funding": [ … … 2174 2350 { 2175 2351 "name": "symfony/polyfill-intl-grapheme", 2176 "version": "v1.3 1.0",2352 "version": "v1.32.0", 2177 2353 "source": { 2178 2354 "type": "git", … … 2232 2408 ], 2233 2409 "support": { 2234 "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.3 1.0"2410 "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" 2235 2411 }, 2236 2412 "funding": [ … … 2252 2428 { 2253 2429 "name": "symfony/polyfill-intl-normalizer", 2254 "version": "v1.3 1.0",2430 "version": "v1.32.0", 2255 2431 "source": { 2256 2432 "type": "git", … … 2313 2489 ], 2314 2490 "support": { 2315 "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.3 1.0"2491 "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" 2316 2492 }, 2317 2493 "funding": [ … … 2333 2509 { 2334 2510 "name": "symfony/polyfill-mbstring", 2335 "version": "v1.3 1.0",2511 "version": "v1.32.0", 2336 2512 "source": { 2337 2513 "type": "git", 2338 2514 "url": "https://github.com/symfony/polyfill-mbstring.git", 2339 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" 2340 }, 2341 "dist": { 2342 "type": "zip", 2343 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", 2344 "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", 2345 "shasum": "" 2346 }, 2347 "require": { 2515 "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" 2516 }, 2517 "dist": { 2518 "type": "zip", 2519 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", 2520 "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", 2521 "shasum": "" 2522 }, 2523 "require": { 2524 "ext-iconv": "*", 2348 2525 "php": ">=7.2" 2349 2526 }, … … 2393 2570 ], 2394 2571 "support": { 2395 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.3 1.0"2572 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" 2396 2573 }, 2397 2574 "funding": [ … … 2409 2586 } 2410 2587 ], 2411 "time": "2024- 09-09T11:45:10+00:00"2588 "time": "2024-12-23T08:48:59+00:00" 2412 2589 }, 2413 2590 { 2414 2591 "name": "symfony/polyfill-php73", 2415 "version": "v1.3 1.0",2592 "version": "v1.32.0", 2416 2593 "source": { 2417 2594 "type": "git", … … 2469 2646 ], 2470 2647 "support": { 2471 "source": "https://github.com/symfony/polyfill-php73/tree/v1.3 1.0"2648 "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" 2472 2649 }, 2473 2650 "funding": [ … … 2489 2666 { 2490 2667 "name": "symfony/polyfill-php80", 2491 "version": "v1.3 1.0",2668 "version": "v1.32.0", 2492 2669 "source": { 2493 2670 "type": "git", 2494 2671 "url": "https://github.com/symfony/polyfill-php80.git", 2495 "reference": " 60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"2496 }, 2497 "dist": { 2498 "type": "zip", 2499 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/ 60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",2500 "reference": " 60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",2672 "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" 2673 }, 2674 "dist": { 2675 "type": "zip", 2676 "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", 2677 "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", 2501 2678 "shasum": "" 2502 2679 }, … … 2549 2726 ], 2550 2727 "support": { 2551 "source": "https://github.com/symfony/polyfill-php80/tree/v1.3 1.0"2728 "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" 2552 2729 }, 2553 2730 "funding": [ … … 2565 2742 } 2566 2743 ], 2567 "time": "202 4-09-09T11:45:10+00:00"2744 "time": "2025-01-02T08:10:11+00:00" 2568 2745 }, 2569 2746 { … … 2714 2891 { 2715 2892 "name": "symfony/string", 2716 "version": "v6.4. 15",2893 "version": "v6.4.21", 2717 2894 "source": { 2718 2895 "type": "git", 2719 2896 "url": "https://github.com/symfony/string.git", 2720 "reference": "73 a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f"2721 }, 2722 "dist": { 2723 "type": "zip", 2724 "url": "https://api.github.com/repos/symfony/string/zipball/73 a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",2725 "reference": "73 a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",2897 "reference": "73e2c6966a5aef1d4892873ed5322245295370c6" 2898 }, 2899 "dist": { 2900 "type": "zip", 2901 "url": "https://api.github.com/repos/symfony/string/zipball/73e2c6966a5aef1d4892873ed5322245295370c6", 2902 "reference": "73e2c6966a5aef1d4892873ed5322245295370c6", 2726 2903 "shasum": "" 2727 2904 }, … … 2780 2957 ], 2781 2958 "support": { 2782 "source": "https://github.com/symfony/string/tree/v6.4. 15"2959 "source": "https://github.com/symfony/string/tree/v6.4.21" 2783 2960 }, 2784 2961 "funding": [ … … 2796 2973 } 2797 2974 ], 2798 "time": "202 4-11-13T13:31:12+00:00"2975 "time": "2025-04-18T15:23:29+00:00" 2799 2976 }, 2800 2977 { … … 3092 3269 { 3093 3270 "name": "wp-coding-standards/wpcs", 3094 "version": " 2.3.0",3271 "version": "3.1.0", 3095 3272 "source": { 3096 3273 "type": "git", 3097 3274 "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 3098 "reference": "7da1894633f168fe244afc6de00d141f27517b62" 3099 }, 3100 "dist": { 3101 "type": "zip", 3102 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", 3103 "reference": "7da1894633f168fe244afc6de00d141f27517b62", 3104 "shasum": "" 3105 }, 3106 "require": { 3275 "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" 3276 }, 3277 "dist": { 3278 "type": "zip", 3279 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", 3280 "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", 3281 "shasum": "" 3282 }, 3283 "require": { 3284 "ext-filter": "*", 3285 "ext-libxml": "*", 3286 "ext-tokenizer": "*", 3287 "ext-xmlreader": "*", 3107 3288 "php": ">=5.4", 3108 "squizlabs/php_codesniffer": "^3.3.1" 3109 }, 3110 "require-dev": { 3111 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", 3289 "phpcsstandards/phpcsextra": "^1.2.1", 3290 "phpcsstandards/phpcsutils": "^1.0.10", 3291 "squizlabs/php_codesniffer": "^3.9.0" 3292 }, 3293 "require-dev": { 3294 "php-parallel-lint/php-console-highlighter": "^1.0.0", 3295 "php-parallel-lint/php-parallel-lint": "^1.3.2", 3112 3296 "phpcompatibility/php-compatibility": "^9.0", 3113 "phpcsstandards/phpcsdevtools": "^1. 0",3114 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 "3297 "phpcsstandards/phpcsdevtools": "^1.2.0", 3298 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" 3115 3299 }, 3116 3300 "suggest": { 3117 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 3301 "ext-iconv": "For improved results", 3302 "ext-mbstring": "For improved results" 3118 3303 }, 3119 3304 "type": "phpcodesniffer-standard", … … 3132 3317 "phpcs", 3133 3318 "standards", 3319 "static analysis", 3134 3320 "wordpress" 3135 3321 ], … … 3139 3325 "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" 3140 3326 }, 3141 "time": "2020-05-13T23:57:56+00:00" 3327 "funding": [ 3328 { 3329 "url": "https://opencollective.com/php_codesniffer", 3330 "type": "custom" 3331 } 3332 ], 3333 "time": "2024-03-25T16:39:00+00:00" 3142 3334 }, 3143 3335 { 3144 3336 "name": "wp-hooks/wordpress-core", 3145 "version": "1. 9.0",3337 "version": "1.10.0", 3146 3338 "source": { 3147 3339 "type": "git", 3148 3340 "url": "https://github.com/wp-hooks/wordpress-core-hooks.git", 3149 "reference": " 8cc9adaf9a87670ac434d440eb66d06d65ec215c"3150 }, 3151 "dist": { 3152 "type": "zip", 3153 "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/ 8cc9adaf9a87670ac434d440eb66d06d65ec215c",3154 "reference": " 8cc9adaf9a87670ac434d440eb66d06d65ec215c",3341 "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148" 3342 }, 3343 "dist": { 3344 "type": "zip", 3345 "url": "https://api.github.com/repos/wp-hooks/wordpress-core-hooks/zipball/127af21a918a52bcead7ce9b743b17b5d64eb148", 3346 "reference": "127af21a918a52bcead7ce9b743b17b5d64eb148", 3155 3347 "shasum": "" 3156 3348 }, … … 3162 3354 "oomphinc/composer-installers-extender": "^2", 3163 3355 "roots/wordpress-core-installer": "^1.0.0", 3164 "roots/wordpress-full": "6. 7",3356 "roots/wordpress-full": "6.8", 3165 3357 "wp-hooks/generator": "1.0.0" 3166 3358 }, … … 3213 3405 "support": { 3214 3406 "issues": "https://github.com/wp-hooks/wordpress-core-hooks/issues", 3215 "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1. 9.0"3407 "source": "https://github.com/wp-hooks/wordpress-core-hooks/tree/1.10.0" 3216 3408 }, 3217 3409 "funding": [ … … 3221 3413 } 3222 3414 ], 3223 "time": "202 4-12-04T23:00:43+00:00"3415 "time": "2025-04-16T22:20:41+00:00" 3224 3416 } 3225 3417 ], … … 3229 3421 "prefer-stable": false, 3230 3422 "prefer-lowest": false, 3231 "platform": { 3232 "php": ">=7.0" 3233 }, 3423 "platform": {}, 3234 3424 "platform-dev": {}, 3235 3425 "plugin-api-version": "2.6.0" -
smntcs-simple-events-widget/trunk/includes/class-smntcs-simple-events-widget.php
r3260220 r3490507 19 19 */ 20 20 public function __construct() { 21 $widget_options = array(21 $widget_options = [ 22 22 'classname' => 'smntcs_simple_events_widget', 23 23 'description' => 'Display Simple Events Widget', 24 );24 ]; 25 25 parent::__construct( 'smntcs_simple_events_widget', 'Simple Events Widget', $widget_options ); 26 26 } … … 33 33 */ 34 34 public function widget( $args, $instance ) { 35 $title = apply_filters( 'widget_title', $instance['title'] ); 36 $timestamp = current_time( 'timestamp' ); 35 $title = apply_filters( 'widget_title', $instance['title'] ); 36 // Event meta is stored as UTC Unix timestamps; compare using the current instant. 37 $timestamp = time(); 38 39 $sort_order = isset( $instance['sort_order'] ) && 'DESC' === $instance['sort_order'] ? 'DESC' : 'ASC'; 37 40 38 41 echo wp_kses_post( $args['before_widget'] ); … … 41 44 } 42 45 43 $query_args = array( 44 'post_type' => array( 'post', 'page' ), 45 'meta_key' => 'datepicker_start', 46 'orderby' => 'meta_value', 47 'order' => 'DESC', 48 ); 46 $query_args = [ 47 'post_type' => [ 'post', 'page', 'product' ], 48 'meta_key' => 'datepicker_start', 49 'orderby' => 'meta_value', 50 'order' => $sort_order, 51 'meta_type' => 'NUMERIC', 52 'posts_per_page' => -1, 53 ]; 49 54 50 55 if ( 'upcoming-events' === $instance['display_events'] ) { 51 $query_args['meta_query'] = array(52 array(56 $query_args['meta_query'] = [ 57 [ 53 58 'key' => 'datepicker_start', 54 59 'value' => $timestamp, 55 60 'compare' => '>=', 56 61 'type' => 'NUMERIC', 57 ),58 );62 ], 63 ]; 59 64 } 60 65 61 66 if ( 'previous-events' === $instance['display_events'] ) { 62 $query_args['meta_query'] = array(63 array(67 $query_args['meta_query'] = [ 68 [ 64 69 'key' => 'datepicker_start', 65 70 'value' => $timestamp, 66 71 'compare' => '<', 67 72 'type' => 'NUMERIC', 68 ),69 );73 ], 74 ]; 70 75 } 71 76 72 77 $the_query = new WP_Query( $query_args ); 78 79 $date_title_separator = ! empty( $instance['date_title_line_break'] ) ? ': <br />' : ': '; 73 80 74 81 if ( $the_query->have_posts() ) { … … 77 84 $the_query->the_post(); 78 85 $start_date_meta = get_post_meta( get_the_ID(), 'datepicker_start', true ); 79 $start_date = $start_date_meta ? gmdate( get_option( 'date_format' ), intval( $start_date_meta )) : __( 'No start date', 'smntcs-simple-events-widget' );86 $start_date = $start_date_meta ? date_i18n( get_option( 'date_format' ), intval( $start_date_meta ), true ) : __( 'No start date', 'smntcs-simple-events-widget' ); 80 87 $end_date_meta = get_post_meta( get_the_ID(), 'datepicker_end', true ); 81 $end_date = $end_date_meta ? gmdate( get_option( 'date_format' ), intval( $end_date_meta ) ) : __( 'No end date', 'smntcs-simple-events-widget' ); 82 83 $link = get_permalink(); 88 $end_date = $end_date_meta ? date_i18n( get_option( 'date_format' ), intval( $end_date_meta ), true ) : __( 'No end date', 'smntcs-simple-events-widget' ); 89 $link = get_permalink(); 84 90 85 91 if ( 'start-and-end-date' === $instance['display_dates'] ) { 86 92 printf( 87 '<li>%s - %s :<br><a href="%s">%s</a><br><br></li>',93 '<li>%s - %s%s<a href="%s">%s</a></li>', 88 94 esc_html( $start_date ), 89 95 esc_html( $end_date ), 96 wp_kses_post( $date_title_separator ), 90 97 esc_url( $link ), 91 98 esc_html( get_the_title() ) … … 93 100 } else { 94 101 printf( 95 '<li>%s :<br><a href="%s">%s</a><br><br></li>',102 '<li>%s%s<a href="%s">%s</a></li>', 96 103 esc_html( $start_date ), 104 wp_kses_post( $date_title_separator ), 97 105 esc_url( $link ), 98 106 esc_html( get_the_title() ) … … 139 147 </select> 140 148 </p> 149 <p> 150 <label for="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>"><?php esc_html_e( 'Sort order:', 'smntcs-simple-events-widget' ); ?></label> 151 <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'sort_order' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'sort_order' ) ); ?>"> 152 <option <?php selected( $instance['sort_order'] ?? 'ASC', 'ASC' ); ?> value="ASC"><?php esc_html_e( 'Ascending (earliest first)', 'smntcs-simple-events-widget' ); ?></option> 153 <option <?php selected( $instance['sort_order'] ?? 'ASC', 'DESC' ); ?> value="DESC"><?php esc_html_e( 'Descending (latest first)', 'smntcs-simple-events-widget' ); ?></option> 154 </select> 155 </p> 156 <p> 157 <input class="checkbox" type="checkbox" <?php checked( ! empty( $instance['date_title_line_break'] ) ); ?> id="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'date_title_line_break' ) ); ?>" value="1"> 158 <label for="<?php echo esc_attr( $this->get_field_id( 'date_title_line_break' ) ); ?>"><?php esc_html_e( 'Line break between date and title', 'smntcs-simple-events-widget' ); ?></label> 159 </p> 141 160 <?php 142 161 } … … 153 172 $instance = $old_instance; 154 173 155 $instance['title'] = strip_tags( $new_instance['title'] ); 156 $instance['display_events'] = strip_tags( $new_instance['display_events'] ); 157 $instance['display_dates'] = strip_tags( $new_instance['display_dates'] ); 174 $instance['title'] = wp_strip_all_tags( $new_instance['title'] ); 175 $instance['display_events'] = wp_strip_all_tags( $new_instance['display_events'] ); 176 $instance['display_dates'] = wp_strip_all_tags( $new_instance['display_dates'] ); 177 178 $raw_sort = isset( $new_instance['sort_order'] ) ? strtoupper( wp_strip_all_tags( $new_instance['sort_order'] ) ) : 'ASC'; 179 $instance['sort_order'] = ( 'DESC' === $raw_sort ) ? 'DESC' : 'ASC'; 180 $instance['date_title_line_break'] = ! empty( $new_instance['date_title_line_break'] ) ? '1' : ''; 158 181 159 182 return $instance; -
smntcs-simple-events-widget/trunk/includes/class-smntcs-simple-events.php
r2994698 r3490507 19 19 */ 20 20 public function __construct() { 21 add_action( 'plugins_loaded', array( $this, 'load_textdomain' ));22 add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), array( $this, 'plugin_settings_link' ));23 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ));24 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ));25 add_action( 'save_post', array( $this, 'save_post' ));26 add_action( 'widgets_init', array( $this, 'widgets_init' ));21 add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] ); 22 add_filter( 'plugin_action_links_' . plugin_basename( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ), [ $this, 'plugin_settings_link' ] ); 23 add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] ); 24 add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] ); 25 add_action( 'save_post', [ $this, 'save_post' ] ); 26 add_action( 'widgets_init', [ $this, 'widgets_init' ] ); 27 27 } 28 28 … … 57 57 $plugin_data = get_plugin_data( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ); 58 58 wp_enqueue_script( 'jquery-ui-datepicker' ); 59 wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', array( 'jquery' ), $plugin_data['Version']);60 wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', array(), $plugin_data['Version'] );59 wp_enqueue_script( 'smntcs-simple-events-script', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . 'js/custom.js', [ 'jquery' ], $plugin_data['Version'], true ); 60 wp_enqueue_style( 'smntcs-simple-events-styles', plugin_dir_url( SMNTCS_SIMPLE_EVENTS_WIDGET_PLUGIN_FILE ) . '/js/jquery-ui.css', [], $plugin_data['Version'] ); 61 61 } 62 62 … … 67 67 */ 68 68 public function add_meta_boxes() { 69 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'post', 'side' ); 70 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), array( $this, 'display_callback' ), 'page', 'side' ); 69 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'post', 'side' ); 70 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'page', 'side' ); 71 72 // Add meta box for WooCommerce products if WooCommerce is active. 73 if ( class_exists( 'WooCommerce' ) ) { 74 add_meta_box( 'meta-box-id', __( 'Event', 'smntcs-simple-events-widget' ), [ $this, 'display_callback' ], 'product', 'side' ); 75 } 71 76 } 72 77 … … 108 113 // Check for nonce. 109 114 if ( ! isset( $_POST['smntcs_wpnonce'] ) || 110 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) {115 ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['smntcs_wpnonce'] ) ), 'smntcs_add_simple_event' ) ) { 111 116 return; 112 117 } … … 165 170 */ 166 171 public static function timestamp_to_date( $timestamp ) { 167 return gmdate( 'd-m-Y', $timestamp );172 return date_i18n( get_option( 'date_format' ), $timestamp ); 168 173 } 169 174 } -
smntcs-simple-events-widget/trunk/smntcs-simple-events-widget.php
r3260220 r3490507 3 3 * Plugin Name: SMNTCS Simple Events Widget 4 4 * Plugin URI: https://github.com/nielslange/smntcs-simple-events-widget 5 * Description: Add meta box to posts and pages, to select event start and end date and show upcoming and previous events assidebar widget.5 * Description: Add event start and optional end dates on posts, pages, and WooCommerce products; list them in a customizable sidebar widget. 6 6 * Author: Niels Lange 7 7 * Author URI: https://nielslange.de 8 8 * Text Domain: smntcs-simple-events-widget 9 * Version: 2. 49 * Version: 2.5 10 10 * Requires PHP: 7.4 11 11 * Requires at least: 3.4
Note: See TracChangeset
for help on using the changeset viewer.