craft.request.getParam('entryId') returns null on edit page of an entry
craft()-&gt;request-&gt;getParam() is only going to check for the value as part of the query string in the URI or in POST if it is a POST request, which is why it's returning null on the edit entry page in the control panel (it isn't in either).

But since it looks like you're using a template hook in your plugin, you can get the entry id directly from the context:

$entry = $context['entry'];

if (!$entry-&gt;id)
{
    // New entry
}
else
{
    $entryId = $entry-&gt;id;
}