add support for ymd

This commit is contained in:
John Bintz 2009-11-25 16:53:37 -05:00
parent 28d631c1ba
commit 4831a731d1
2 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,7 @@ class ComicPressBackendFilesystem extends ComicPressBackend {
function _replace_type($post, $type) { return $type; }
function _replace_y_m_d($post, $type) { return date('Y-m-d', strtotime($post->post_date)); }
function _replace_ymd($post, $type) { return date('Ymd', strtotime($post->post_date)); }
function _replace_year($post, $type) { return date('Y', strtotime($post->post_date)); }
function _replace_categories($post, $type) {
if (count($post_categories = wp_get_post_categories($post->ID)) == 1) {

View File

@ -22,6 +22,7 @@ class ComicPressBackendFilesystemTest extends PHPUnit_Framework_TestCase {
array('%test%/comic/*.jpg', array('/comic/*.jpg')),
array('%wordpress%/%type%/*.jpg', array('/wordpress/comic/*.jpg')),
array('%wordpress%/comic/%y-m-d%*.jpg', array('/wordpress/comic/2009-01-01*.jpg')),
array('%wordpress%/comic/%ymd%*.jpg', array('/wordpress/comic/20090101*.jpg')),
array('%wordpress%/comic/%year%/%y-m-d%*.jpg', array('/wordpress/comic/2009/2009-01-01*.jpg')),
array(
'%wordpress%/comic/%categories%/%y-m-d%*.jpg',