diff --git a/classes/backends/ComicPressBackendFilesystem.inc b/classes/backends/ComicPressBackendFilesystem.inc index 6747f21..9631dcb 100644 --- a/classes/backends/ComicPressBackendFilesystem.inc +++ b/classes/backends/ComicPressBackendFilesystem.inc @@ -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) { diff --git a/test/backends/ComicPressBackendFilesystemTest.php b/test/backends/ComicPressBackendFilesystemTest.php index f95457f..1f0fa12 100644 --- a/test/backends/ComicPressBackendFilesystemTest.php +++ b/test/backends/ComicPressBackendFilesystemTest.php @@ -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',