{"id":23284,"date":"2013-05-05T19:45:17","date_gmt":"2013-05-05T19:45:17","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/am-events\/"},"modified":"2017-11-14T21:18:16","modified_gmt":"2017-11-14T21:18:16","slug":"am-events","status":"publish","type":"plugin","link":"https:\/\/frp.wordpress.org\/plugins\/am-events\/","author":12114788,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.13.1","stable_tag":"1.13.1","tested":"4.8.28","requires":"3.3.1","requires_php":"","requires_plugins":"","header_name":"AM Events","header_author":"Atte Moisio","header_description":"","assets_banners_color":"8f97a1","last_updated":"2017-11-14 21:18:16","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/am-events\/","header_author_uri":"http:\/\/attemoisio.fi","rating":4.7,"author_block_rating":0,"active_installs":90,"downloads":14171,"num_ratings":7,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.13.1":"<ul>\n<li>Fixes a debug PHP error on some admin pages<\/li>\n<\/ul>","1.13.0":"<ul>\n<li>Replaces jQuery datepicker with flatpickr<\/li>\n<\/ul>","1.12.0":"<ul>\n<li>Updates jQuery UI date\/time picker<\/li>\n<\/ul>","1.11.0":"<ul>\n<li>Adds new conditional shortcodes for venues and categories<\/li>\n<\/ul>","1.10.0":"<ul>\n<li>Adds hooks for including extra fields to event posts<\/li>\n<li>Adds [meta] shortcode for widget<\/li>\n<\/ul>","1.9.8":"<ul>\n<li>Fixes problems with tags<\/li>\n<\/ul>","1.9.7":"<ul>\n<li>Fixes admin panel event list ordering<\/li>\n<\/ul>","1.9.6":"<ul>\n<li>Fixes tags being stripped from recurring events<\/li>\n<\/ul>","1.9.5":"<ul>\n<li>Fixes compatibility with WordPress 4.3<\/li>\n<\/ul>","1.9.4":"<ul>\n<li>Fixes date localization issues.<\/li>\n<\/ul>","1.9.3":"<ul>\n<li>Fixes widget category and venue filtering bug<\/li>\n<\/ul>","1.9.2":"<ul>\n<li>Adds thumbnail shortcode for widget<\/li>\n<li>Fixes some translations<\/li>\n<\/ul>","1.9.1":"<ul>\n<li>Fixes a bug when removing event categories from recurring events<\/li>\n<\/ul>","1.9.0":"<ul>\n<li>Improves handling of recurring events<\/li>\n<li>Adds start and end date to quick edit<\/li>\n<li>Many small improvements<\/li>\n<\/ul>","1.8.0":"<ul>\n<li>Adds conditional tags for the widget<\/li>\n<\/ul>","1.7.1":"<ul>\n<li>Adds French language<\/li>\n<\/ul>","1.7.0":"<ul>\n<li>Adds option to change slug for event posts<\/li>\n<li>Adds [excerpt] shortcode for the widget<\/li>\n<li>Adds customizable &quot;No upcoming events&quot; message to widget<\/li>\n<li>Adds option to change offset for events shown in the widget<\/li>\n<\/ul>","1.6.0":"<ul>\n<li>Adds option to change time picker minute step<\/li>\n<li>Fixes featured image and excerpts not copying when creating recurrent events<\/li>\n<\/ul>","1.5.1":"<ul>\n<li>Fixes a few minor bugs<\/li>\n<\/ul>","1.5.0":"<ul>\n<li>Adds support for thumbnails and excerpts<\/li>\n<\/ul>","1.4.0":"<ul>\n<li>Adds new improved widget shortcode system<\/li>\n<\/ul>","1.3.1":"<ul>\n<li>Fixes minor bugs in template tags<\/li>\n<\/ul>","1.3.0":"<ul>\n<li>Adds template tags for getting\/displaying event data<\/li>\n<\/ul>","1.2.1":"<ul>\n<li>Fixes localization typos<\/li>\n<li>Adds simple WP_Query tutorial to readme.txt<\/li>\n<\/ul>","1.2.0":"<ul>\n<li>Adds support for php 5.2 (previously needed 5.3)<\/li>\n<li>Fixes bugs.<\/li>\n<\/ul>","1.1.0":"<ul>\n<li>Adds localization support for date format.<\/li>\n<\/ul>","1.0.1":"<ul>\n<li>Fixes bugs in the upcoming events -widget<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":"1","4":0,"5":"6"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1020809","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1020809","resolution":"256x256","location":"assets"},"icon-64x64.png":{"filename":"icon-64x64.png","revision":"1020809","resolution":"64x64","location":"assets"}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1766333","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.1.0","1.10.0","1.11.0","1.12.0","1.13.0","1.13.1","1.2.0","1.2.1","1.3.0","1.3.1","1.4.0","1.5.0","1.5.1","1.6.0","1.7.0","1.7.1","1.8.0","1.9.0","1.9.1","1.9.2","1.9.3","1.9.4","1.9.5","1.9.6","1.9.7","1.9.8"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":"835425","resolution":"1","location":"assets"},"screenshot-2.jpg":{"filename":"screenshot-2.jpg","revision":"836693","resolution":"2","location":"assets"},"screenshot-3.jpg":{"filename":"screenshot-3.jpg","revision":"835573","resolution":"3","location":"assets"},"screenshot-4.jpg":{"filename":"screenshot-4.jpg","revision":"835573","resolution":"4","location":"assets"}},"screenshots":{"1":"Creating an event","2":"Widget administration","3":"Example page with events and the widget."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[416,4708,2431,1486,27101],"plugin_category":[40,43],"plugin_contributors":[84859],"plugin_business_model":[],"class_list":["post-23284","plugin","type-plugin","status-publish","hentry","plugin_tags-calendar","plugin_tags-dates","plugin_tags-event","plugin_tags-events","plugin_tags-venue","plugin_category-calendar-and-events","plugin_category-customization","plugin_contributors-moisture","plugin_committers-moisture"],"banners":{"banner":"https:\/\/ps.w.org\/am-events\/assets\/banner-772x250.png?rev=1766333","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/am-events\/assets\/icon-128x128.png?rev=1020809","icon_2x":"https:\/\/ps.w.org\/am-events\/assets\/icon-256x256.png?rev=1020809","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/am-events\/assets\/screenshot-1.jpg?rev=835425","caption":"Creating an event"},{"src":"https:\/\/ps.w.org\/am-events\/assets\/screenshot-2.jpg?rev=836693","caption":"Widget administration"},{"src":"https:\/\/ps.w.org\/am-events\/assets\/screenshot-3.jpg?rev=835573","caption":"Example page with events and the widget."},{"src":"https:\/\/ps.w.org\/am-events\/assets\/screenshot-4.jpg?rev=835573","caption":""}],"raw_content":"<!--section=description-->\n<p>The purpose of this plugin is to add an event type similar to the normal post type. By design this plugin doesn't provide any ready-made layouts, and allows the events to be fully integrated and customized to the theme of your choosing.<\/p>\n\n<h3>Current Features<\/h3>\n\n<ul>\n<li>Admin pages to view\/create\/modify events.<\/li>\n<li>Available data fields for events: start date, end date, venue, category<\/li>\n<li>Create weekly or biweekly recurring events<\/li>\n<li>Fully customizable widget for displaying upcoming events.<\/li>\n<\/ul>\n\n<p>The custom post type created by the plugin is named 'am_event' and has two taxonomies: 'am_event_categories' and 'am_venues'. Dates are stored as post metadata. Displaying the events is done in the theme files using WP_Query and the template tags provided by the plugin. This allows full control over the layout and what elements to show.<\/p>\n\n<p>The widget for displaying upcoming events uses a simple template system for full control of the layout.<\/p>\n\n<p>If you think something critical is missing, feel free to send me a request.<\/p>\n\n<p>The plugin is available in the following languages (pot-file included for additional translations):<\/p>\n\n<ul>\n<li>English<\/li>\n<li>French<\/li>\n<li>Norwegian<\/li>\n<li>Finnish<\/li>\n<\/ul>\n\n<h3>TUTORIAL<\/h3>\n\n<p>For integrating AM Events to an existing theme, I suggest creating a <a href=\"http:\/\/codex.wordpress.org\/Child_Themes\">child theme<\/a> with custom page templates. You can find an example of a working Twenty Twelve child theme from <a href=\"https:\/\/github.com\/attemoi\/am-events-child-theme\">https:\/\/github.com\/attemoi\/am-events-child-theme<\/a> containing three different page templates for event pages.<\/p>\n\n<h4>Widget<\/h4>\n\n<p>Here are the shortcodes available in the upcoming events widget template.<\/p>\n\n<ul>\n<li>[event-title]<\/li>\n<li>[start-date]<\/li>\n<li>[end-date]<\/li>\n<li>[event-venue]<\/li>\n<li>[event-category]<\/li>\n<li>[content]<\/li>\n<li>[thumbnail]<\/li>\n<li>[excerpt]<\/li>\n<li>[permalink]<\/li>\n<li>[meta]<\/li>\n<\/ul>\n\n<p>Conditional shortcodes:<\/p>\n\n<ul>\n<li>[if cond=\"startdate-is-enddate\"]<\/li>\n<li>[if cond=\"startdate-not-enddate\"]<\/li>\n<li>[if cond=\"startday-is-endday\"]<\/li>\n<li>[if cond=\"startday-not-endday\"]<\/li>\n<li>[if cond=\"has-venue\"]<\/li>\n<li>[if cond=\"has-category\"]<\/li>\n<\/ul>\n\n<p>The title can be linked to the event post with the 'link' attribute, e.g. [event-title link=true]<\/p>\n\n<p>The category and venue can also be linked similarly to their respective archive pages using the 'link' attribute, e.g. [event-category link=true]<\/p>\n\n<p>The number of words displayed in the title, content or excerpt can be limited by the 'limit' attribute, e.g. [content limit=25] or [event-title limit=10].<\/p>\n\n<p>The dates can be formatted using the 'format' attribute, e.g. [start-date format='d.m.Y H:i'] (see <a href=\"http:\/\/php.net\/manual\/en\/function.date.php\">PHP date<\/a> for formatting options). If no format is given, the default WordPress date format is used.<\/p>\n\n<p>You can use any shortcode as many times as needed in a single template. To separate date and time of start date for example you could write:<\/p>\n\n<pre><code>[start-date format='d.m.Y']\n&lt;span&gt;divider&lt;\/span&gt;\n[start-date format='H:i']\n<\/code><\/pre>\n\n<p>Example usage of conditional shortcode:<\/p>\n\n<pre><code>[start-date format='D d.m.Y H:s']\n[if cond='startdate-not-enddate']\n - [end-date format='D d.m.Y H:s']\n[\/if]\n<\/code><\/pre>\n\n<h4>Template tags<\/h4>\n\n<p>Template tags were introduced in version 1.3.0 and are listed below. More documentation can be found in the source files.<\/p>\n\n<pre><code>\/\/ Template tags for getting and displaying event dates\nam_the_startdate($format = 'Y-m-d H:i:s', $before = '', $after = '', $echo = true)\nam_get_the_startdate( $format = 'Y-m-d H:i:s', $post = 0 )\nam_the_enddate($format = 'Y-m-d H:i:s', $before = '', $after = '', $echo = true)\nam_get_the_enddate( $format = 'Y-m-d H:i:s', $post = 0 )\n\n\/\/ Template tags for getting and displaying event venues\nam_get_the_venue( $id = false )\nam_in_venue( $venue, $post = null )\nam_get_the_venue_list( $separator = '', $parents='', $post_id = false )\nam_the_venue( $separator = '', $parents='', $post_id = false )\n\n\/\/ Template tags for getting and displaying event categories\nam_get_the_event_category( $id = false )\nam_get_the_event_category_list( $separator = '', $parents='', $post_id = false )\nam_in_event_category( $eventCategory, $post = null )\nam_the_event_category( $separator = '', $parents='', $post_id = false )\n<\/code><\/pre>\n\n<p>Example of displaying the first category of the current event post:<\/p>\n\n<pre><code>$categoryArray = am_get_the_event_category();\necho $categoryArray[0]-&gt;name;&lt;h3&gt;Creating a WP_Query&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>The custom post type is named 'am_event'\nThe taxonomies are named 'am_venues' and 'am_event_categories'.<\/p>\n\n<p>The event post has metadata named 'am_startdate' and 'am_enddate' that are formatted like 'yyyy-mm-dd hh:mm'<\/p>\n\n<p>So suppose I wanted to display all events with a category of 'other' and venue 'mcdonalds'. I would then make a WP_Query like this:<\/p>\n\n<pre><code>$args = array(\n        'post_type' =&gt; 'am_event',\n        'post_status' =&gt; 'publish',\n        'tax_query' =&gt; array(\n                'relation' =&gt; 'AND',\n                array(\n                    'taxonomy' =&gt; 'am_venues',\n                    'field' =&gt; 'name',\n                    'terms' =&gt; 'mcdonalds',\n                ),\n                array(\n                    'taxonomy' =&gt; 'am_event_categories',\n                    'field' =&gt; 'name',\n                    'terms' =&gt; 'other'\n                ),\n        ),\n    );\n\n$the_query = new WP_Query($args);\n\nif ($the_query-&gt;have_posts()) {\n    while ($the_query-&gt;have_posts()) {\n        $the_query-&gt;the_post();\n\n        $postId = $post-&gt;ID;\n\n        \/\/ Use template tags to get start and end date\n        $startDate = am_get_the_startdate('Y-m-d H:i:s');\n        $endDate = am_get_the_enddate('Y-m-d H:i:s');\n\n        \/\/ Use template tags to get venues and categories in an array\n        $venues = am_get_the_venue( $postId );\n        $eventCategories = am_get_the_category( $postId );\n\n        \/\/ All the other functions used for posts like\n        \/\/ the_title() and the_content() work just like with normal posts.\n\n        \/\/ ...  DISPLAY POST CONTENT HERE ... \/\/\n\n    }\n}\n<\/code><\/pre>\n\n<p>If you want the events ordered by start date, add the following to $args:<\/p>\n\n<pre><code>'orderby' =&gt; 'meta_value',\n'meta_key' =&gt; 'am_startdate',\n'order' =&gt; 'ASC',\n<\/code><\/pre>\n\n<p>If you need to display only upcoming events, add the following meta_query argument to $args:<\/p>\n\n<pre><code>'meta_query' =&gt; array(\n        array(\n            'key' =&gt; 'am_enddate',\n            'value' =&gt; date('Y-m-d H:i:s', time()),\n            'compare' =&gt; \"&gt;\",\n        ),\n),\n<\/code><\/pre>\n\n<p>The plugin folder also contains a file \"examples.php\", which contains an example function for displaying upcoming events in a table.<\/p>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<ol>\n<li>Upload folder <code>am-events<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.13.1<\/h4>\n\n<ul>\n<li>Fix PHP debug error on some admin pages<\/li>\n<\/ul>\n\n<h4>1.13.0<\/h4>\n\n<ul>\n<li>Replace jQuery datetimepicker with flatpickr<\/li>\n<\/ul>\n\n<h4>1.12.0<\/h4>\n\n<ul>\n<li>Updated jQuery UI date\/time picker<\/li>\n<\/ul>\n\n<h4>1.11.0<\/h4>\n\n<ul>\n<li>Added new conditional shortcodes for venues and categories<\/li>\n<\/ul>\n\n<h4>1.10.0<\/h4>\n\n<ul>\n<li>Added hooks for including extra fields to event posts<\/li>\n<li>Added [meta] shortcode for widget<\/li>\n<\/ul>\n\n<h4>1.9.8<\/h4>\n\n<ul>\n<li>Fixed problem with tags<\/li>\n<\/ul>\n\n<h4>1.9.7<\/h4>\n\n<ul>\n<li>Fixed admin panel event list ordering<\/li>\n<\/ul>\n\n<h4>1.9.6<\/h4>\n\n<ul>\n<li>Fixed tags being stripped from recurring events<\/li>\n<\/ul>\n\n<h4>1.9.5<\/h4>\n\n<ul>\n<li>Fixed compatibility with WordPress 4.3<\/li>\n<\/ul>\n\n<h4>1.9.4<\/h4>\n\n<ul>\n<li>Fixed date localization issues<\/li>\n<\/ul>\n\n<h4>1.9.3<\/h4>\n\n<ul>\n<li>Fixed widget category and venue filtering bug<\/li>\n<\/ul>\n\n<h4>1.9.2<\/h4>\n\n<ul>\n<li>Translation fixes.<\/li>\n<li>Added thumbnail shortcode to widget<\/li>\n<\/ul>\n\n<h4>1.9.1<\/h4>\n\n<ul>\n<li>Fixed bug when removing event categories from recurring events<\/li>\n<\/ul>\n\n<h4>1.9.0<\/h4>\n\n<ul>\n<li>Improved handling of recurring events<\/li>\n<li>Added start and end dates to quick edit<\/li>\n<\/ul>\n\n<h4>1.8.0<\/h4>\n\n<ul>\n<li>Added conditional tags for the widget<\/li>\n<\/ul>\n\n<h4>1.7.1<\/h4>\n\n<ul>\n<li>Added French language<\/li>\n<\/ul>\n\n<h4>1.7.0<\/h4>\n\n<ul>\n<li>Added option to change slug for event posts<\/li>\n<li>Added [excerpt] shortcode for the widget<\/li>\n<li>Added customizable \"No upcoming events\" message to widget<\/li>\n<li>Added option to change how long passed events are shown in the widget<\/li>\n<\/ul>\n\n<h4>1.6.0<\/h4>\n\n<ul>\n<li>Added option to change time picker minute step<\/li>\n<li>Fixed featured image and excerpts not copying when creating recurrent events<\/li>\n<\/ul>\n\n<h4>1.5.1<\/h4>\n\n<ul>\n<li>Fixed a few minor bugs<\/li>\n<\/ul>\n\n<h4>1.5.0<\/h4>\n\n<ul>\n<li>Added support for thumbnail and excerpt for event posts<\/li>\n<\/ul>\n\n<h4>1.4.0<\/h4>\n\n<ul>\n<li>Added new improved widget template shortcode system<\/li>\n<\/ul>\n\n<h4>1.3.1<\/h4>\n\n<ul>\n<li>Fixed minor bugs in template tags<\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>Added template tags for getting and displaying event data<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>Fixed localization typos<\/li>\n<li>Added simple WP_Query tutorial in 'Other Notes'<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Added support for PHP 5.2 (previously needed 5.3)<\/li>\n<li>Fixed multiple bugs<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Added localization to date format<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Fixed bugs in the upcoming events -widget<\/li>\n<li>Added missing examples.php<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First released\/stable version<\/li>\n<\/ul>","raw_excerpt":"Manage and display your events. Allows fully customizable layouts and includes a widget for upcoming events.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/23284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=23284"}],"author":[{"embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/moisture"}],"wp:attachment":[{"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=23284"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=23284"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=23284"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=23284"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=23284"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/frp.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=23284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}