Download the PHP package sectsect/cfs-loop-field-query without Composer
On this page you can find all versions of the php package sectsect/cfs-loop-field-query. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cfs-loop-field-query
CFS Loop Field Query - For Events -
Modify the Query to multiple dates in a post For Custom Field Suite "Loop Field".
Features
For each Date and Time
set in the Loop Field
, only the scheduled events are output to Archive Page.
- The
Date and Time
set in theLoop Field
is outputted asone event
. - Displayed in order of the most recent event (
ASC
). - Closed events is not outputted.
- Supply a
function
for calendar :date:
Requirements
- PHP 5.3+
- Activation Custom Field Suite Plugin.
- Create a Loop Field and Date Field in the Loop Field using CFS Plugin.
- A 6-pack of beer🍺 (optional, I guess.)
Installation
cd /path-to-your/wp-content/plugins/
git clone [email protected]:sectsect/cfs-loop-field-query.git
- Activate the plugin through the 'Plugins' menu in WordPress.
You can access the some setting by going toSettings
->CFS Loop Field Query
. - Setting
Post Type Name
,Loop Field Name
,Date Field Name
in Loop Feld".
( Optional Field:Taxonomy Name
,StartTime Field
,FinishTime Field
)
That's it:ok_hand: The main query of your select post types will be modified.
Fields Structure Example
TIP
- If you want to apply to some existing article, resave the article.
- This Plugin includes adding Time-Picker Field in CFS. (Using CFS Time picker add-on)
- Support Pages for
is_date()
includesis_year()
is_month()
is_day()
. - If you have set the 'FinishTime', it does not appear that post when it passes your set time. (Default: The Day Full)
Usage Example
You can get a sub query with new CFS_LFQ_Query()
Example: Sub Query
Example: Sub Query For Calendar w/ cfs_lfq_calendar()
Example: Sub Query For Calendar w/ Your Calendar Class
Example: Get the "Date", "StartTime" and "FinishTime"
function
get_months_from_now($num)
Parameters
- num
(integer) (required) Number of months to get.
Default:1
Return Values
(array)
Ym
formatted.
cfs_lfq_calendar($args)
Parameters
-
dates (array) (required) Array of event Date (
Ymd
format). -
months (array) (required) Array of month to generate calendar (
Ym
format) -
weekdayLabel (string) (optional) Available value:
'default'
or'en'
.
Default:'default'
:memo:'default'
is based on your wordpress locale setting. -
weekdayBase (integer) (optional) The start weekday.
0:sunday ~ 6:saturday
Default:0
-
element (string) (optional) The element for wraping.
Default:'div'
- class
(string) (optional) The 'class' attribute value for wrap element.
Default:''
Example
NOTES for Developer
- This Plugin does not hosting on the wordpress.org repo in order to prevent a flood of support requests from wide audience.
Change log
See CHANGELOG file.
Contributing
- Create an issue and describe your idea
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Publish the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Profit! :white_check_mark:
License
See LICENSE file.
Related Plugin
I also have plugin with the same functionality for Advanced Custom Field Plugin.