wp-includes category-template.php

The category-template.php file has 2 occurrences of is_a to test for objects of the Walker class. There are at least 6 subclasses of the Walker class within the WordPress Core.

function walk_category_tree() {
	$args = func_get_args();
	// the user's options are the third parameter
//	if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
	$class_name = 'Walker';
	if ( empty($args[2]['walker'])
	 || ( ( get_class($args[2]['walker']) != $class_name )
	 && !is_subclass_of($args[2]['walker'], $class_name) ) )
		$walker = new Walker_Category;
.....
function walk_category_dropdown_tree() {
	$args = func_get_args();
	// the user's options are the third parameter
//	if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
	$class_name = 'Walker';
	if ( empty($args[2]['walker'])
	 || ( ( get_class($args[2]['walker']) != $class_name )
	 && !is_subclass_of($args[2]['walker'], $class_name) ) )
		$walker = new Walker_CategoryDropdown;
.....
Technorati Tags: ,

One Trackback

  1. By the Mittineague Blog -> is_a Conclusion on July 29, 2009 at 3:10 pm

    [...] wp-includes/category-template.php [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*