First, check for syntax errors. The syntax highlighting seems to indicate that you have syntax errors.
Second, don’t wrap your add_action()
calls inside conditionals; rather, wrap your callback function content inside the conditionals, e.g.:
<?php
function theme_upgrade_alernt() {
if ( is_admin() && $pagenow == 'theme-install.php' && $_GET['tab']=="upload"){
// CODE GOES HERE
} else {
// ELSE CODE GOES HERE
}
}
add_action('admin_print_scripts', 'theme_upgrade_alert');
?>
I would also recommend enqueueing your scripts at admin_enqueue_scripts
, rather than admin_print_scripts
.