內容簡介
TSBusinessDay是一個具有限制內容功能的類別,根據營業時間進行限制。支持跨越午夜的營業時間。將最終發展成一個完整的外掛程式,但多虧了Elliot Condon,我現在還不需要!
依賴項
該函數需要使用Advanced Custom Fields插件中的一些附加功能,如下所示:
Repeater Field
Options Page
Date & Time Picker Field
Repeater Field和Options Page是高級附加功能。如果您已經在使用它們,您就會了解它們的寶貴價值。如果沒有,那麼現在是開始使用的最佳時機!
安裝
確保您擁有所有必需的依賴項。
下載ts-business-hours目錄,並將其複製到wp-content/plugins中。
在外掛程式頁面上啟用外掛程式。
轉到選項頁面。配置天數和營業時間。您必須擁有開始和結束時間。
必須從星期天開始並在星期六結束,插件才能正常工作。這是因為插件使用了date('w')功能。
參考example.php,並相應地使用。
備註
我在本地工作時遇到了一個問題,那就是我必須等到分鐘翻轉才能看到模板檔案的更改實際反映出來。我不知道這是為什麼,希望能得到建議!
TS是什麼意思?
Tribeswell是一家專門從事高品質響應式網站設計的互動營銷公司。我們是偉大設計和易用性的學生。選擇與Tribeswell合作意味著您的組織將獲得現代設計中的絕對最佳。我們的總部位於印第安納州布魯明頓,並與整個中西部的客戶合作。
關於作者
Zack來自印第安納州貝德福德市,目前在Tribeswell全職工作。Zack對前端設計和UX充滿熱情。他的工作是確保每個Tribeswell網站都有完美的適合度和完美度,為訪問者提供卓越的體驗。
外掛標籤
開發者團隊
原文外掛簡介
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:
Repeater Field
Options Page
Date & Time Picker Field
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
Make sure you have all of the required dependencies.
Download the ts-business-hours directory and copy it to wp-content/plugins.
Activate the plugin on the Plugins page.
Navigate to the Options page. Configure days and hours. You must have both opening and closing times.
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.
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.
