Skip to content

Commit 9f28a8f

Browse files
author
Miika Arponen
committed
Permalink id parameter
1 parent a74e2a8 commit 9f28a8f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

dust/.DS_Store

6 KB
Binary file not shown.

dust/Helper/.DS_Store

6 KB
Binary file not shown.

helpers/permalink.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<?php
22
$this->dust->helpers['permalink'] = function ( \Dust\Evaluate\Chunk $chunk, \Dust\Evaluate\Context $ctx, \Dust\Evaluate\Bodies $bodies, \Dust\Evaluate\Parameters $params ) {
3-
return $chunk->write( get_permalink() );
3+
4+
if ( isset( $params->id ) ) {
5+
$id = $params->id;
6+
}
7+
else {
8+
$id = get_the_ID();
9+
}
10+
11+
return $chunk->write( get_permalink( $id ) );
412
};

0 commit comments

Comments
 (0)