Skip to content

Commit

Permalink
Updated the readme.txt for v0.9.
Browse files Browse the repository at this point in the history
Added a test for the new category attributes in the `wpt_events` shortcode.
  • Loading branch information
slimndap committed Oct 25, 2014
1 parent f4d0b1a commit a35f6ec
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
6 changes: 3 additions & 3 deletions functions/wpt_frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function wpt_events($atts, $content=null) {
'upcoming' => 'true',
'past' => false,
'paginateby'=>array(),
'category'=> false, // deprecated since v0.8.4.
'category'=> false, // deprecated since v0.9.
'cat'=>false,
'category_name'=>false,
'category__and'=>false,
Expand Down Expand Up @@ -198,7 +198,7 @@ function wpt_events($atts, $content=null) {
}

/**
* Deprecated since v0.8.4.
* Deprecated since v0.9.
* Use `cat`, `category_name`, `category__and`, `category__in` or `category__not_in` instead.
*/

Expand Down Expand Up @@ -280,7 +280,7 @@ function wpt_productions($atts, $content=null) {
}

/**
* Deprecated since v0.8.4.
* Deprecated since v0.9.
* Use `cat`, `category_name`, `category__and`, `category__in` or `category__not_in` instead.
*/

Expand Down
17 changes: 16 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: slimndap
Tags: theatre, stage, venue, events, shows, concerts, tickets, ticketing, sports, performances, calendar, workshops, theater, cinema
Requires at least: 3.8
Tested up to: 3.9
Tested up to: 4.0
Stable tag: trunk
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -76,6 +76,21 @@ The new feature may be added directly to the Theater plugin or as an extension s

== Changelog ==

= 0.9 =
* Added support for start and end dates in `[wpt_events]` shortcode. You can throw anything at it that strtotime understands! Some examples:
* `[wpt_events start="now"]`
* `[wpt_events start="today"]`
* `[wpt_events start="2014-09-02"]`
* `[wpt_events end="now"]`
* `[wpt_events start="2014-09-01" end="2014-10-01"]`
* `[wpt_events start="now" end="+1 week"]`
* `[wpt_events start="next Monday" end="next Monday +1 week"]`
* Removed WordPress SEO by Yoast meta box from event admin screens.


= 0.8.3 =
* Bugfixes.

= 0.8.2 =
* New date filter for template placeholder: `{{datetime|date('D j')}}`. Thank you [Epco](http://wordpress.org/support/profile/epco)!
* Show all events for today or tomorrow: `[wpt_events day="today"]` and `[wpt_events day="tomorrow"]`. Thank you [mychelemy](https://github.com/mychelemy)!
Expand Down
29 changes: 29 additions & 0 deletions tests/test_theatre.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,35 @@ function test_shortcode_wpt_events_filter_season() {
}

function test_shortcode_wpt_events_filter_category() {

// test with cat
$result = do_shortcode('[wpt_events cat="'.$this->category_film.','.$this->category_muziek.'"]');
$this->assertEquals(3, substr_count($result, '"wp_theatre_event"'), $result);

$result = do_shortcode('[wpt_events cat="-'.$this->category_film.','.$this->category_muziek.'"]');
$this->assertEquals(1, substr_count($result, '"wp_theatre_event"'), $result);

// test with category_name
$this->assertEquals(3, substr_count(do_shortcode('[wpt_events category_name="muziek"]'), '"wp_theatre_event"'));

$result = do_shortcode('[wpt_events category_name="muziek,film"]');
$this->assertEquals(3, substr_count($result, '"wp_theatre_event"'), $result);

// test with an excluded category__in
$this->assertEquals(2, substr_count(do_shortcode('[wpt_events category__in="'.$this->category_film.'"]'), '"wp_theatre_event"'));

// test with category__not_in
// should list events from all productions except 1.
$this->assertEquals(2, substr_count(do_shortcode('[wpt_events category__not_in="'.$this->category_film.'"]'), '"wp_theatre_event"'));

// test with category__and_in
$this->assertEquals(2, substr_count(do_shortcode('[wpt_events category__and="'.$this->category_film.','.$this->category_muziek.'"]'), '"wp_theatre_event"'));



}

function test_shortcode_wpt_events_filter_category_deprecated() {
$this->assertEquals(3, substr_count(do_shortcode('[wpt_events category="muziek"]'), '"wp_theatre_event"'));
}

Expand Down
4 changes: 2 additions & 2 deletions theater.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://wordpress.org/plugins/theatre/
Description: Turn your Wordpress website into a theater website.
Author: Jeroen Schmit, Slim & Dapper
Version: 0.8.3
Version: 0.9
Author URI: http://slimndap.com/
Text Domain: wp_theatre
Domain Path: /lang
Expand All @@ -25,7 +25,7 @@
* echo $wp_theatre->events->html_listing($args); // a list of all upcoming events, paginated by month
*/

$wpt_version = '0.8.3';
$wpt_version = '0.9';

class WP_Theatre {
function __construct() {
Expand Down

0 comments on commit a35f6ec

Please sign in to comment.