Using $_GET in Functions.php [closed]

Not really a WordPress related question, but the answer is fairly simple. When you try to call an element of a array that doesn’t exist, you will get an undefined index error, since it simply doesn’t exist.

$_GET is a superglobal array, so this is the case. To fix this issue, you should first check and see if that particular element is set.

For example:

function hire_more() {
    if ( isset( $_GET['hire_more'] ) ) {
        $hire = $_GET['hire_more'];
        write_log($hire);
    }

}
add_action('wp_loaded','hire_more');