| @@ -236,11 +236,39 @@ | ||
| 236 | 236 | endif; |
| 237 | 237 | } /* add_post_meta() */ |
| 238 | 238 | } /* if */ |
| 239 | 239 | |
| 240 | -function fwp_category_checklist ($post_id = 0, $descendents_and_self = 0, $selected_cats = false) { | |
| 240 | +if (!function_exists('disabled')) { | |
| 241 | + /** | |
| 242 | + * Outputs the html disabled attribute. | |
| 243 | + * | |
| 244 | + * Compares the first two arguments and if identical marks as disabled | |
| 245 | + * | |
| 246 | + * @since 3.0.0 | |
| 247 | + * | |
| 248 | + * @param mixed $disabled One of the values to compare | |
| 249 | + * @param mixed $current (true) The other value to compare if not just true | |
| 250 | + * @param bool $echo Whether to echo or just return the string | |
| 251 | + * @return string html attribute or empty string | |
| 252 | + */ | |
| 253 | + function disabled( $disabled, $current = true, $echo = true ) { | |
| 254 | + return __checked_selected_helper( $disabled, $current, $echo, 'disabled' ); | |
| 255 | + } | |
| 256 | +} /* if */ | |
| 257 | + | |
| 258 | +require_once(dirname(__FILE__).'/feedwordpress-walker-category-checklist.class.php'); | |
| 259 | + | |
| 260 | +function fwp_category_checklist ($post_id = 0, $descendents_and_self = 0, $selected_cats = false, $prefix = '') { | |
| 241 | 261 | if (function_exists('wp_category_checklist')) : |
| 242 | - wp_category_checklist($post_id, $descendents_and_self, $selected_cats); | |
| 262 | + $walker = new FeedWordPress_Walker_Category_Checklist; | |
| 263 | + $walker->set_prefix($prefix); | |
| 264 | + wp_category_checklist( | |
| 265 | + /*post_id=*/ $post_id, | |
| 266 | + /*descendents_and_self=*/ $descendents_and_self, | |
| 267 | + /*selected_cats=*/ $selected_cats, | |
| 268 | + /*popular_cats=*/ false, | |
| 269 | + /*walker=*/ $walker | |
| 270 | + ); | |
| 243 | 271 | else : |
| 244 | 272 | // selected_cats is an array of integer cat_IDs / term_ids for |
| 245 | 273 | // the categories that should be checked |
| 246 | 274 | global $post_ID; |