Skip to content

Commit

Permalink
Bump version to 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
keesiemeijer committed Feb 20, 2016
1 parent b2d4ffd commit e5d4691
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 40 deletions.
6 changes: 3 additions & 3 deletions custom-post-type-date-archives.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/*
Plugin Name: Custom Post Type Date Archives
Version: 2.0.0
Version: 2.1.0
Plugin URI:
Description: This plugin allows you to add date archives to custom post types in your theme's functions.php file. Adds a post type dropdown to the archives widget.
Description: This plugin allows you to add date archives to custom post types. Adds custom post types to the archive and calendar widget.
Author: keesiemijer
Author URI:
Text Domain: custom-post-type-date-archives
Expand Down Expand Up @@ -131,7 +131,7 @@ private function setup_constants() {

// Plugin version
if ( ! defined( 'CPT_DATE_ARCHIVES_VERSION' ) ) {
define( 'CPT_DATE_ARCHIVES_VERSION', '2.0.0' );
define( 'CPT_DATE_ARCHIVES_VERSION', '2.1.0' );
}

// Plugin Folder Path
Expand Down
65 changes: 50 additions & 15 deletions languages/custom-post-type-date-archives.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# This file is distributed under the GPL v2.
msgid ""
msgstr ""
"Project-Id-Version: Custom Post Type Date Archives 1.1\n"
"Project-Id-Version: Custom Post Type Date Archives 2.1.0\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/custom-post-type-date-archives\n"
"POT-Creation-Date: 2016-02-17 11:04:12+00:00\n"
"POT-Creation-Date: 2016-02-20 14:42:50+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -25,20 +25,60 @@ msgstr ""
"X-Poedit-Bookmarks: \n"
"X-Textdomain-Support: yes\n"

#: custom-post-type-date-archives.php:105
#: custom-post-type-date-archives.php:117
#: custom-post-type-date-archives.php:108
#: custom-post-type-date-archives.php:120
msgid "Cheatin&#8217; huh?"
msgstr ""

#: includes/functions.php:242
#. Plugin Name of the plugin/theme
msgid "Custom Post Type Date Archives"
msgstr ""

#: includes/admin.php:42
msgid "Date Archive"
msgstr ""

#: includes/admin.php:97
msgid "Settings Saved"
msgstr ""

#: includes/admin.php:168 includes/partials/admin-form.php:5
msgid "Date Archives"
msgstr ""

#: includes/admin.php:175
msgid "Could not find the post type for the current screen."
msgstr ""

#: includes/admin.php:183
msgid "This page is generated by the Custom Post Type Date Archives plugin"
msgstr ""

#: includes/functions.php:273
#. translators: 1: month name, 2: 4-digit year
msgid "%1$s %2$d"
msgstr ""

#: includes/functions.php:553
#: includes/functions.php:584
msgid "Posts published on %s"
msgstr ""

#: includes/partials/admin-form.php:10
msgid "Add date archives to this post type"
msgstr ""

#: includes/partials/admin-form.php:12
msgid "Add date archives to the custom post type %s"
msgstr ""

#: includes/partials/admin-form.php:21
msgid "Publish posts with future dates"
msgstr ""

#: includes/partials/admin-form.php:25
msgid "Publish new scheduled posts from the post type %s as normal posts"
msgstr ""

#: includes/partials/archive-widget.php:2
#: includes/partials/calendar-widget.php:2
msgid "Title:"
Expand Down Expand Up @@ -153,28 +193,23 @@ msgstr ""
msgid "A calendar of your site&#8217;s Posts."
msgstr ""

#. Plugin Name of the plugin/theme
msgid "Custom Post Type Date Archives"
msgstr ""

#. Description of the plugin/theme
msgid ""
"This plugin allows you to add date archives to custom post types in your "
"theme's functions.php file. Adds a post type dropdown to the archives "
"widget."
"This plugin allows you to add date archives to custom post types. Adds "
"custom post types to the archive and calendar widget."
msgstr ""

#. Author of the plugin/theme
msgid "keesiemijer"
msgstr ""

#: includes/functions.php:460
#: includes/functions.php:491
#. translators: Calendar caption: 1: month name, 2: 4-digit year
msgctxt "calendar caption"
msgid "%1$s %2$s"
msgstr ""

#: includes/functions.php:552
#: includes/functions.php:583
msgctxt "daily archives date format"
msgid "F j, Y"
msgstr ""
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-post-type-date-archives",
"version": "2.0.0",
"version": "2.1.0",
"tested_up_to": "4.4",
"requires_at_least": "3.9",
"main": "Gruntfile.js",
Expand Down
72 changes: 52 additions & 20 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
# Custom Post Type Date Archives [![Build Status](https://travis-ci.org/keesiemeijer/custom-post-type-date-archives.svg?branch=master)](http://travis-ci.org/keesiemeijer/custom-post-type-date-archives) #
# Custom Post Type Date Archives [![Build Status](https://travis-ci.org/keesiemeijer/custom-post-type-date-archives.svg?branch=develop)](http://travis-ci.org/keesiemeijer/custom-post-type-date-archives) #

Version: 2.0.0
Version: 2.1.0
Requires at least: 3.9
Tested up to: 4.4

Add date archives to custom post types.
Add date archives to WordPress custom post types.

The default archives and calendar widget will be replaced with similar widgets where you can now select a post type.
## Welcome to the GitHub repository for this plugin ##
This is the development repository for the Custom Post Type Date Archives plugin.

WordPress only supports date archives for the `post` post type. With this plugin you can add date archive support for custom post types with the [add_post_type_support()](http://codex.wordpress.org/Function_Reference/add_post_type_support) function. Add `date-archives` to the `$supports` parameter and this plugin will add the rewrite rules needed.
The `master` branch is where you'll find the most recent, stable release.
The `develop` branch is the current working branch for development. Both branches are required to pass all unit tests. Any pull requests are first merged with the `develop` branch before being merged into the `master` branch.

## Plugin Description ##

WordPress only supports date archives for the `post` post type. With this plugin you can add date archives to custom post types and allow scheduled posts to be published as normal posts. This plugin provides functions you can use in your theme template files.

The archives and calendar widget will be replaced with similar widgets where you can now select a post type (and more).

Example url for a custom post type `events` date archive.
```
https://example.com/events/2015/06/12
```

## Pagination
Pagination of cpt date archives works the same as normal date archives. For those needing to paginate by year, month or day there is a seperate plugin that does just that.
https://github.com/keesiemeijer/custom-post-type-date-archives-pagination


## Adding Date Archives in Themes
Add date archives in your (child)t theme's functions.php file with the [add_post_type_support()](http://codex.wordpress.org/Function_Reference/add_post_type_support) function. Add `date-archives` to the `$supports` parameter and this plugin will add the rewrite rules needed.
When registering a custom post type the `has_archive` parameter is required for it to have date archives added. See the example below.

For example, add date archives to a `events` custom post type. Put this in your (child) theme's functions.php file.
Expand All @@ -40,25 +55,14 @@ add_action( 'init', 'post_type_events_init' );

**Note** The functions [register_post_type()](https://codex.wordpress.org/Function_Reference/register_post_type) and [add_post_type_support()](https://codex.wordpress.org/Function_Reference/add_post_type_support) should be called using the `init` action hook, like in the example above.

## future dates
### future dates
To allow future dates for a post type include `publish-future-posts` in the `$supports` parameter.
```php
// Adding date archives and publish future post support for the 'events' custom post type.
add_post_type_support( 'events', array( 'date-archives', 'publish-future-posts' ) );
```
This will set the post status for **newly** published posts with a scheduled **future date** to `publish` instead of `future`. Scheduled (future) posts are no longer hidden in the front end of your site. To update old scheduled posts with the post status `publish` use this [bulk edit trick](http://bobwp.com/bulk-edit-posts-wordpress/) and set the status to `published` for posts with a future date.

To reverse this behaviour for a single post type use the `cptda_publish_future_{post_type}` filter. The following example is for a post type called `events`. Use the code below in your (child) theme's functions.php file.
```php
// Don't publish scheduled posts for the post type 'events'.
// Scheduled posts are still displayed in the 'events' date archives.

add_filter( 'cptda_publish_future_events', '__return_false' );
```
With this in your functions file the post status for **newly** published scheduled `events` remains `future`. Use the same bulk edit trick as above and set the post status to `published` for existing `events` with a future date. It's counterintuitive to set it to `published`, but it will reschedule the posts with a future date with the post status `future`

**Note** If you return false as in the code example above, scheduled future posts are **only** displayed in the custom post type date archives. Don't link to the individual single posts in your theme archive templates as it will go to a 404.

## Functions

These are the functions you can use in your theme template files.
Expand Down Expand Up @@ -115,7 +119,35 @@ cptda_get_month_link( $year, $month, $post_type = '' )
cptda_get_day_link( $year, $month, $day, $post_type = '' )
```

## Pagination
Pagination of cpt date archives is the same as normal date archives. For those needing to paginate by year, month or day there is a seperate plugin that does just that.
https://github.com/keesiemeijer/custom-post-type-date-archives-pagination
## Pull Requests ##
When starting work on a new feature, branch off from the `develop` branch.
```bash
# clone the repository
git clone https://github.com/keesiemeijer/custom-post-type-date-archives.git

# cd into the custom-post-type-date-archives directory
cd custom-post-type-date-archives

# switch to the develop branch
git checkout develop

# create new branch newfeature and switch to it
git checkout -b newfeature develop
```

## Creating a new build ##
To compile the plugin without all the development files use the following commands:
```bash
# Go to the master branch
git checkout master

# Install Grunt tasks
npm install

# Build the production plugin
grunt build
```
The plugin will be compiled in the `build` directory.

## Bugs ##
If you find an issue, let us know [here](https://github.com/keesiemeijer/custom-post-type-date-archives/issues?state=open)!
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: keesiemeijer
Tags: date archives
Requires at least: 3.9
Tested up to: 4.4
Stable tag: 2.0.0
Stable tag: 2.1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down

0 comments on commit e5d4691

Please sign in to comment.