I have a set of plugins that do different things. I'm wanting to write a plugin with a class I can extend in each of my custom plugins to meet a common goal. In my "socket" plugin I have something like this
class socketPlugin {
function __construct($extendedClass){
global $wpdb;
$tablename = $wpdb->prefix."tableName";
$classCount = $wpdb->get_var(
"SELECT COUNT(id) FROM $tablename WHERE extendedClass='$extendedClass'"
);
if($classCount && $classCount > 0){
$wpdb->insert(
$tablename,
array(
'extendedClass' => $extendedClass
)
);
}
}
I then want to do something like this:
class myCustomClass extends socketPlugin {
}
And pass a variable into the constructor. Right now, if I do the above I get the PHP "white screen of death".
Any ideas why I'm getting a white screen? How can I propperly extend the class of the socket plugin?
do_action
andadd_action
to accomplish this...