more work on documentation, add new template tags
This commit is contained in:
parent
b2410a2678
commit
2d03a4db01
@ -56,3 +56,27 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<br style="clear: both" />
|
<br style="clear: both" />
|
||||||
|
|
||||||
|
<h2>Sorting and Attaching Comic Images</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<img src="../images/comic-image-sorter.png" alt="Comic Image Sorter" class="alignright" />
|
||||||
|
|
||||||
|
Once images are attached to a post, you can arrange them and associate sub-image types (such as RSS and Archive images) to their parent image.
|
||||||
|
The order in which images are sorted determines how they are returned by the <code>M()</code> function, and attaching new sub-images to a parent
|
||||||
|
image causes that attached image to replace the original in calls to <code>EM()</code>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
To make them easier you see, you can adjust the image thumbnail size using the zoom slider on the left.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
If you attach new images using the <em>Media Uploader</em>, click the <em>Refersh</em> button to reload the ordering. Any changes not saved via <em>Update post</em> will be lost.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The options shown are with the post attachment backend. Different backends may offer additional options from the ones presented here.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<br style="clear: both" />
|
||||||
|
@ -235,3 +235,27 @@ if (apply_filters('comicpress-RT', 'last', array('child_of' => 'comic'))) {
|
|||||||
|
|
||||||
do_action('comicpress-Unprotect');
|
do_action('comicpress-Unprotect');
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<h2>SL() and SC()</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<code>SL()</code> and <code>SC()</code> give you access to the current storyline category information.
|
||||||
|
<code>SL()</code> lists all of the categories, in order, with the necessary metadata to traverse and understand the structure.
|
||||||
|
<code>SC()</code> lets you quickly traverse the storyline, returning category objects as it goes.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre class="prettyprint lang-php">
|
||||||
|
foreach (SL() as $category_id => $info) {
|
||||||
|
$category = get_category($category_id);
|
||||||
|
printf('Category %d is %d levels deep', $category->name, $info['level']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// by default, SC() returns categories relative to the current post
|
||||||
|
$next = SC('next');
|
||||||
|
$previous = SC('previous');
|
||||||
|
$parent = SC('parent');
|
||||||
|
|
||||||
|
// or you can provide a category to be relative to
|
||||||
|
$next_from_three = SC('next', 3);
|
||||||
|
$previous_to_chapter_four = SC('previous', 'chapter-four');
|
||||||
|
</pre>
|
BIN
docs/images/comic-image-sorter.png
Normal file
BIN
docs/images/comic-image-sorter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 113 KiB |
@ -174,7 +174,7 @@ function SL() {
|
|||||||
return $storyline->_structure;
|
return $storyline->_structure;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SC($which, $relative_to = null) {
|
function SC($which = 'current', $relative_to = null) {
|
||||||
global $post;
|
global $post;
|
||||||
|
|
||||||
$storyline = new ComicPressStoryline();
|
$storyline = new ComicPressStoryline();
|
||||||
@ -192,7 +192,12 @@ function SC($which, $relative_to = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($relative_to)) {
|
if (!is_null($relative_to)) {
|
||||||
if ($result = $storyline->_get_field($which, $relative_to)) {
|
if ($which == 'current') {
|
||||||
|
$result = $relative_to;
|
||||||
|
} else {
|
||||||
|
$result = $storyline->_get_field($which, $relative_to);
|
||||||
|
}
|
||||||
|
if ($result !== false) {
|
||||||
$category = get_category($result);
|
$category = get_category($result);
|
||||||
if (!empty($category)) {
|
if (!empty($category)) {
|
||||||
return $category;
|
return $category;
|
||||||
|
@ -195,6 +195,8 @@ class FunctionsTest extends PHPUnit_Framework_TestCase {
|
|||||||
array('next', null, 3),
|
array('next', null, 3),
|
||||||
array('next', 4, false),
|
array('next', 4, false),
|
||||||
array('test', 4, false),
|
array('test', 4, false),
|
||||||
|
array('current', 1, 1),
|
||||||
|
array('current', null, 2),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user