add support for ymd
This commit is contained in:
parent
28d631c1ba
commit
4831a731d1
|
@ -44,6 +44,7 @@ class ComicPressBackendFilesystem extends ComicPressBackend {
|
||||||
|
|
||||||
function _replace_type($post, $type) { return $type; }
|
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_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_year($post, $type) { return date('Y', strtotime($post->post_date)); }
|
||||||
function _replace_categories($post, $type) {
|
function _replace_categories($post, $type) {
|
||||||
if (count($post_categories = wp_get_post_categories($post->ID)) == 1) {
|
if (count($post_categories = wp_get_post_categories($post->ID)) == 1) {
|
||||||
|
|
|
@ -22,6 +22,7 @@ class ComicPressBackendFilesystemTest extends PHPUnit_Framework_TestCase {
|
||||||
array('%test%/comic/*.jpg', array('/comic/*.jpg')),
|
array('%test%/comic/*.jpg', array('/comic/*.jpg')),
|
||||||
array('%wordpress%/%type%/*.jpg', array('/wordpress/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/%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/%year%/%y-m-d%*.jpg', array('/wordpress/comic/2009/2009-01-01*.jpg')),
|
||||||
array(
|
array(
|
||||||
'%wordpress%/comic/%categories%/%y-m-d%*.jpg',
|
'%wordpress%/comic/%categories%/%y-m-d%*.jpg',
|
||||||
|
|
Loading…
Reference in New Issue