Changeset 490865
- Timestamp:
- 01/16/2012 11:33:43 PM (14 years ago)
- Location:
- media-categories-2/trunk
- Files:
-
- 4 added
- 1 edited
-
attachment-walker-category-checklist-class.php (added)
-
media-categories-script.js (added)
-
media-categories-style.css (added)
-
media-categories.php (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
media-categories-2/trunk/readme.txt
r490863 r490865 1 === Category Template Hierarchy===1 === Media Categories === 2 2 Contributors: eddiemoya 3 3 Donate link: http://eddiemoya.com 4 Tags: plugin, theme development, theme, template, hierarchy, category, template hierarchy, subcategory, parent category, child category, parent category, category template5 Requires at least: unknown6 Tested up to: 3. 2.14 Tags: media categories, media, category, categories, attachment categories, taxonomy, category metabox, metabox, admin, media library, media editor, attachment editor 5 Requires at least: 3.0 6 Tested up to: 3.3.1 7 7 Stable tag: trunk 8 8 9 A dds parent-category.php & child-category.php to the template hierarchy with all the normal hierarchical behavior with conditional tags to match9 Allows users to assign categories to items in their Media Library with a clean and simplified, filterable version of the standard category meta box 10 10 11 11 == Description == 12 12 13 Adds `parent-category.php` and `child-category.php` with all the normal hierarchical behavior of the native category templates. This greatly extends the natural hierarchy of theme templates with regard to categories. Theme developers can now easily create separate templates for categories with have children, the children themselves, and categories which are neither. As a happy accident to how this was written, developers can also target templates that both are a parent, and have a parent. 13 Allows users to assign categories to items in their Media Library with a clean and simplified, filterable version of the standard category meta box. 14 The filter allows you to narrow your search for category as you type - this filter is not native to WordPress but is instead borrowed from Jason Corradino's 15 [Searchable Categories](http://wordpress.org/extend/plugins/searchable-categories/) plugin. If you would like to enable this feature for your posts and pages 16 [download his plugin here](http://wordpress.org/extend/plugins/searchable-categories/) 14 17 15 Also adds `is_parent_category()` and `is_child_category()` functions for easy use in themes. 18 == Related Plugins == 16 19 17 == Developer Notes: Template Hierarchy == 20 As stated in the description, the filtering ability in this plugin is taken from Jason Corradino's 21 [Searchable Categories](http://wordpress.org/extend/plugins/searchable-categories/) plugin. While I do 22 not employ the plugin directory, the javascript used for filtering is in fact derived with consent from 23 that plugin. To enable this feature on all you category metabox, the 24 [Searchable Categories](http://wordpress.org/extend/plugins/searchable-categories/) plugin 18 25 19 What follows are the lists by which the new hierarchical elements will cascade - realize that all these lists are essentially just branches off of the existing [Template Hierarchy](http://codex.wordpress.org/Template_Hierarchy#Visual_Overview). 26 I'd like to point out that I drew some inspiration from the ['WOS Media Categories'](http://suburbia.org.uk/page/projects.html#wos_media_categories) plugin which 27 is not generally easy to find since its not in the plugin directory. However [WOS Media Categories](http://suburbia.org.uk/page/projects.html#wos_media_categories) 28 was missing the clean simple to use hierarchical category interface that we are used to in 29 WordPress. A couple of my projects were dependant that plugin, but as the scale of the project 30 increased and the number of categories grew exponentially, the disorganized grid of checkboxes 31 were no longer a viable option. 20 32 21 If category has no children and has no parent (stand-alone category): 22 23 * `category-{slug}.php` 24 * `category-{term_id}.php` 25 * `category.php` 26 * `archive.php` 27 * `index.php` 28 29 If category is a parent (has children): 30 31 * parent-category-{slug}.php 32 * parent-category-{term_id}.php 33 * parent-category.php 34 * category.php 35 * archive.php 36 * index.php 33 = TL;DR = 34 Checkout these related plugins from which I borrowed code and drew inspiration. 37 35 38 If category is a child (has a parent): 39 40 * child-category-{slug}.php 41 * child-category-{term_id}.php 42 * child-category.php 43 * category.php 44 * archive.php 45 * index.php 36 * [Searchable Categories](http://wordpress.org/extend/plugins/searchable-categories/) by Jason Corradino 37 * [WOS Media Categories](http://suburbia.org.uk/page/projects.html#wos_media_categories) by Rick Curran 46 38 47 48 Additionally, as a happy accident, you can also target categories that are both parents and children: 49 50 * parent-child-category-{slug}.php 51 * parent-child-category-{term_id}.php 52 * parent-child-category.php 53 * parent-category.php 54 * archive.php 55 * index.php 56 57 58 == Developer Notes: Condional Tags == 59 60 With this plugin comes two additional [conditional tags](http://codex.wordpress.org/Conditional_Tags) which behave much like any other in WordPress. In a similar fashion to how one might use [is_category()](http://codex.wordpress.org/Function_Reference/is_category), developers may, with this plugin, use the following functions: 61 62 63 `is_parent_category()` 64 `is_child_category()` 65 66 = Description = 67 These conditional tags checks if the page being displayed is for hierarchical category that has children (e.g. is a parent category), or has a parent (is a child) respectively. They are boolean functions, meaning they return either TRUE or FALSE. 68 69 = Usage = 70 `<?php is_parent_category( $category ); ?>` 71 `<?php is_child_category( $category ); ?>` 72 73 74 = Parameters = 75 76 $category (integer/string/object) (optional) Category ID, Category Slug, Category Object. Default: Current Category 77 78 Note: Unlike is_category(), these functions will not take arrays of categories or category titles. I'll work on that. Sorry. 79 80 = Return Values = 81 (boolean) True on success, false on failure. 82 83 = Examples = 84 ` 85 is_parent_category() 86 is_child_category() 87 // When any parent/child category archive page is being displayed 88 89 is_parent_category( '9' ); 90 is_child_category( '9' ); 91 // When the archive page for Category 9 is being displayed AND its a parent/child. 92 93 is_parent_category( 'blue-cheese' ); 94 is_child_category( 'blue-cheese' ); 95 // When the archive page for the Category with Category Slug "blue-cheese" is being displayed AND its a parent/child. 96 ` 97 98 = Notes = 99 * Clearly there is a need to have is_child_category_of() and is_parent_category_of(). They will be made available in future releases. 100 101 39 WOS is not as relevant since this plugin supplants that one, but the Searchable Categories plugin is a 40 great simple plugin which adds very useful functionality that I think should be included in WordPress Core. 102 41 103 42 == Installation == … … 107 46 108 47 109 == Frequently Asked Questions==48 == Changelog == 110 49 111 = Do you have any Frequently Asked Questions? = 112 113 No. 114 115 = Why not? = 116 117 Because I only just recently released the plugin. I feel that I've done a decent job of documentation, so I can't guess what people may ask on this broadly applicable plugin. 118 119 = Can I ask you a question = 120 121 Please do! Feel free to ask on the tools provided right in the WordPress plugin directory, or on my website [eddiemoya.com](http://eddiemoya.com/) 122 No, plugins are not loaded during installation. For alternative solutions see 123 "Other manifestations, alternative solutions" on the plugin home page. 50 = 1.0 = 51 * Initial commit.
Note: See TracChangeset
for help on using the changeset viewer.