plugin/pdc-locations
Composer 安装命令:
composer require plugin/pdc-locations
包简介
Plugin to attach locations to a PDC item
README 文档
README
This README documents whatever steps are necessary to get this plugin up and running.
How do I get set up?
- Unzip and/or move all files to the /wp-content/plugins/pdc-locations directory
- Log into WordPress admin and activate the ‘PDC Locations’ plugin through the ‘Plugins’ menu
Filters & Actions
There are various hooks, which allows for changing the output.
Action for changing main Plugin object
'owc/pdc-locations/plugin'
See OWC\PDC\Locations\Config->set method for a way to change this plugins config.
Via the plugin object the following config settings can be adjusted
- metaboxes
- rest_api_fields
Translations
If you want to use your own set of labels/names/descriptions and so on you can do so. All text output in this plugin is controlled via the gettext methods.
Please use your preferred way to make your own translations from the /wp-content/plugins/pdc-locations/languages/pdc-locations.pot file
Be careful not to put the translation files in a location which can be overwritten by a subsequent update of the plugin, theme or WordPress core.
We recommend using the 'Loco Translate' plugin. https://wordpress.org/plugins/loco-translate/
This plugin provides an easy interface for custom translations and a way to store these files without them getting overwritten by updates.
For instructions how to use the 'Loco Translate' plugin, we advice you to read the Beginners's guide page on their website: https://localise.biz/wordpress/plugin/beginners or start at the homepage: https://localise.biz/wordpress/plugin
Running tests
To run the Unit tests go to a command-line.
cd /path/to/wordpress/htdocs/wp-content/plugins/pdc-locations/
composer install
phpunit
For code coverage report, generate report with command line command and view results with browser.
phpunit --coverage-html ./tests/coverage
Contribution guidelines
Writing tests
Have a look at the code coverage reports to see where more coverage can be obtained. Write tests Create a Pull request to the OWC repository
Who do I talk to?
If you have questions about or suggestions for this plugin, please contact Holger Peters from Gemeente Buren.
Hooks
In this section, you can customize the messages displayed for the opening hours of a location. The hooks allow you to modify the "open now" message dynamically, based on the location's open and close times.
Example: Customizing the "Open Now" Message
The following filters let you customize the message that appears, in the REST API output, when a location is currently open. By default, the message format is: Now open from %s to %s hour.
You can use the filters below to change this to a more concise format, such as displaying only the closing time of the location.
/** * Modify the "Open Now" message for the general opening hours. * Default message: "Now open from %s to %s hour" * Custom message: "Nu open tot %s" (Dutch for "Now open until %s") */ add_filter('owc/pdc-locations/openingshours/open-now-message', function ($openNowMessage, $openTime, $closeTime) { return sprintf('Nu open tot %s', $closeTime); }, 10, 3); /** * Modify the "Open Now" message for custom opening hours. * This hook works similarly to the above but targets locations with specific custom schedules. * Custom message: "Nu open tot %s" (Dutch for "Now open until %s") */ add_filter('owc/pdc-locations/custom-openingshours/open-now-message', function ($openNowMessage, $openTime, $closeTime) { return sprintf('Nu open tot %s', $closeTime); }, 10, 3);
You can easily modify the message by updating the sprintf statement to suit your needs.
plugin/pdc-locations 适用场景与选型建议
plugin/pdc-locations 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 355 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 plugin/pdc-locations 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 plugin/pdc-locations 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 355
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-09-09