wp-includes widgets.php

Only 1 is_a

function the_widget($widget, $instance = array(), $args = array()) {
.....
//	if ( !is_a($widget_obj, 'WP_Widget') )
	$class_name = 'WP_Widget';
	if ( ( get_class($widget_obj) != $class_name )
	 && !is_subclass_of($widget_obj, $class_name) )
Technorati Tags: ,

wp-includes user.php

There are 2 functions with is_a in this file.

function wp_authenticate_username_password($user, $username, $password) {
function wp_authenticate_cookie($user, $username, $password) {
//	if ( is_a($user, 'WP_User') ) { return $user; }
	$class_name = 'WP_User';
	if ( ( get_class($user) == $class_name )
	 || is_subclass_of($user, $class_name) ) { return $user; }
Technorati Tags: ,

WordPress and it's Coding Standards

WordPress has guidelines for coding style, WordPress Coding Standards. Unfortunately, even WordPress Core files do not always follow these guidelines. To be fair, as my coding skills have progressed, the code in my many files varies in style too, so I can understand how the code of different authors would vary. But this has presented some problems for my finding WordPress Classes and Functions. I recently discovered that the regex I had been using was missing the few (102 out of 3090) functions that have a space between the function's name and the opening parenthesis. I also realized that a few PHP files contain javascript functions and these were mistakenly being listed as PHP functions (at least 26 of them).

The list of The PHP Classes and Functions of WordPress 2.8 has now been modified to be more correct.

Technorati Tags: , ,

wp-includes script-loader.php

This file has 4 occurrences of is_a

function print_head_scripts() {
function print_footer_scripts() {
function wp_print_head_scripts() {
.....
//	if ( !is_a($wp_scripts, 'WP_Scripts') )
	$class_name = 'WP_Scripts';
	if ( ( get_class($wp_scripts) != $class_name )
	 && !is_subclass_of($wp_scripts, $class_name) )

function print_admin_styles() {
.....
//	if ( !is_a($wp_styles, 'WP_Styles') )
	$class_name = 'WP_Styles';
	if ( ( get_class($wp_styles) != $class_name )
	 && !is_subclass_of($wp_styles, $class_name) )
Technorati Tags: ,

wp-includes pluggable.php

This file also contains only 1 is_a

function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
.....
//	if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) {
	$class_name = 'PHPMailer';
	if ( !is_object( $phpmailer )
	 || ( ( get_class($phpmailer) != $class_name )
	 && !is_subclass_of($phpmailer, $class_name) ) ) {
Technorati Tags: ,