Template.php - Hiding Specific Element on Node Edit Drupal 7

Say I have a custom element being rendered out on my page.tpl.php (say it's named $custom_element in the below example), but this is also showing up on the Node Edit page because I want this user to not use the admin theme to edit Nodes but just same theme the front end is using to edit Nodes. 

What hook do I use to hide this element when the user is editing the node? What's the best approach in this? 

My template.php file

function mytheme_preprocess_page(&amp;$vars, $hook) {
  if (in_array('page__mypagetype', $vars['theme_hook_suggestions'])) {
    $vars['custom_element'] = my_custom_element();
  }
}


Sorry if this doesn't make sense. I'm not sure I'm using the proper wording. Basically trying to figure out how to say "Drupal, while the user in logged in and editing these nodes, please don't show this element on the node edit page since it's printed in the page.tpl.php".

I know this can be done by creating a page--node--edit.tpl.php page. But isn't there a way to do this via a hook in the template.php?
As fast solution, verify the value returned from arg(2) is different from 'edit'.

   function mytheme_preprocess_page(&amp;$vars, $hook) {
      if (in_array('page__mypagetype', $vars['theme_hook_suggestions']) &amp;&amp; arg(2) != 'edit) {
        $vars['custom_element'] = my_custom_element();
      }
    }