Template coding practice(function used as user variable)
-
I’m studying the very basics of WordPress template creation and one of the templates has me scratching my head. I’m stepping through this block of code and writing an explanation of what is going on for my own benifit and then studying the WordPress codex to make sure I understand the functions used. I think the code block below has a user defined variable named after a WordPress function. It works alright but I’m just trying to make sure I don’t get the wrong idea about coding practices or maybe I’m confused about the usage.
In this block of code lines 3 and 4 the use of $category is what I’m questioning.$categories_list = get_categories('hide_empty=0&orderby=name'); $getcat = array(); foreach($categories_list as $category){ $getcat[$category->cat_ID] = $item->cat_name; } $category_dropdown = array_unshift($getcat, "Choose a category:");
I appreciate any guidance and light someone could shed on this issue.
- The topic ‘Template coding practice(function used as user variable)’ is closed to new replies.