diff --git a/docs/en_US/media-uploader.html b/docs/en_US/media-uploader.html index c111f6a..75dd82e 100644 --- a/docs/en_US/media-uploader.html +++ b/docs/en_US/media-uploader.html @@ -56,3 +56,27 @@
+
+
+ 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 M()
function, and attaching new sub-images to a parent
+ image causes that attached image to replace the original in calls to EM()
.
+
+ To make them easier you see, you can adjust the image thumbnail size using the zoom slider on the left. +
+ ++ If you attach new images using the Media Uploader, click the Refersh button to reload the ordering. Any changes not saved via Update post will be lost. +
+ ++ The options shown are with the post attachment backend. Different backends may offer additional options from the ones presented here. +
+ +
- R()
and RT()
find posts that are relative to the current or provided post.
- R()
returns the found post, while RT()
sets up the post so that you can use
- standard WordPress template tags on the found posts as if it was part of the current Loop:
+ R()
and RT()
find posts that are relative to the current or provided post.
+ R()
returns the found post, while RT()
sets up the post so that you can use
+ standard WordPress template tags on the found posts as if it was part of the current Loop:
@@ -23,109 +23,109 @@ Restore(); // restore the saved Loop postBasic Interactive Usage Sample
R() and RT() options
- Both
R()
andRT()
accept up to three parameters: + BothR()
andRT()
accept up to three parameters:@@ -149,25 +149,25 @@ R('previous', null, $other_post);Valid strings
- If you want a more sophisticated search, you can provide an array that, with each match, will add the matching categories to the search list. - You can preface any of the keys with an exclamation point to remove matches from the list. + If you want a more sophisticated search, you can provide an array that, with each match, will add the matching categories to the search list. + You can preface any of the keys with an exclamation point to remove matches from the list.
- If you're using RT()
tags to modify the current post, and need to work with the saved post, use Restore()
:
+ If you're using RT()
tags to modify the current post, and need to work with the saved post, use Restore()
:
@@ -235,3 +235,27 @@ if (apply_filters('comicpress-RT', 'last', array('child_of' => 'comic'))) { do_action('comicpress-Unprotect');+ +
+ SL()
and SC()
give you access to the current storyline category information.
+ SL()
lists all of the categories, in order, with the necessary metadata to traverse and understand the structure.
+ SC()
lets you quickly traverse the storyline, returning category objects as it goes.
+
+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'); +\ No newline at end of file diff --git a/docs/images/comic-image-sorter.png b/docs/images/comic-image-sorter.png new file mode 100644 index 0000000..57d097e Binary files /dev/null and b/docs/images/comic-image-sorter.png differ diff --git a/functions.inc b/functions.inc index 2634d25..f477a58 100644 --- a/functions.inc +++ b/functions.inc @@ -174,7 +174,7 @@ function SL() { return $storyline->_structure; } -function SC($which, $relative_to = null) { +function SC($which = 'current', $relative_to = null) { global $post; $storyline = new ComicPressStoryline(); @@ -192,7 +192,12 @@ function SC($which, $relative_to = null) { } 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); if (!empty($category)) { return $category; diff --git a/test/FunctionsTest.php b/test/FunctionsTest.php index 1cb5e72..896a8ad 100644 --- a/test/FunctionsTest.php +++ b/test/FunctionsTest.php @@ -195,6 +195,8 @@ class FunctionsTest extends PHPUnit_Framework_TestCase { array('next', null, 3), array('next', 4, false), array('test', 4, false), + array('current', 1, 1), + array('current', null, 2), ); }