這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

TS Business Hours

描述

TSBusinessDay class with functions used for restricting content based on hours of operation. Supports hours that run past midnight. Will eventually develop into full-fledged plugin, but thanks to Elliot Condon, I don’t have to just yet!

Dependencies

This function requires the Advanced Custom Fields plugin and some of its add-ons. They are as follows:

The Repeater Field and Options page are premium add-ons. If you are already using them, you understand how invaluable they are. If not, there’s no better time to start!

Installation

  1. Make sure you have all of the required dependencies.
  2. Download the ts-business-hours directory and copy it to wp-content/plugins.
  3. Activate the plugin on the Plugins page.
  4. Navigate to the Options page. Configure days and hours. You must have both opening and closing times.
  5. You must start the week on Sunday and end it on Saturday for the plugin to work correctly. This is because the plugin uses the date(‘w’) function.
  6. See example.php and use accordingly.

Notes

I ran into an issue when working locally, which was that I had to wait until the turn of a minute to see my changes to the template file reflected live. I’m not sure why that is and would love to hear suggestions!

What does ‘TS’ stand for, anyway?

Tribeswell is an interactive marketing company specializing in high quality responsive website design. We are students of great design and useability. Choosing to work with Tribeswell means your organization will get the absolute best in modern design. We are headquartered in Bloomington, Indiana and work with clients all across the midwest.

About the Author

Originally from Bedford, Indiana, Zack is currently working full-time at Tribeswell. Zack is passionate about front-end design and UX. He is instrumental in ensuring that every Tribeswell website contains a flawless level of fit and finish, providing an excellent experience for visitors.

安裝

  1. Make sure you have all of the required dependencies.
  2. Download the ts-business-hours directory and copy it to wp-content/plugins.
  3. Activate the plugin on the Plugins page.
  4. Navigate to the Options page. Configure days and hours. You must have both opening and closing times.
  5. You must start the week on Sunday and end it on Saturday for the plugin to work correctly. This is because the plugin uses the date(‘w’) function.
  6. See example.php and use accordingly.

常見問題

Can I use isOpen() to restrict content within a blog post?

You cannot use a PHP function in a WYSIWYG editor. Shortcodes provide this functionality. Shortcode support for this plugin is on the way!

評價

There are no reviews for this plugin.

貢獻者及開發者

“TS Business Hours” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 TS Business Hours 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

0.1.1

  • Created TSBusinessDay class with several utility functions including isOpen(). All functions can be accessed like so: $this->theFunction().