How to get the node status? I have a function that returns sets of variables. Now, I want to control the return value by using node status. Basically I dont want the value to be returned when the node is unpublished. Any idea? Here is the function by the way. I just need to add a condition in the return value like this if($node-&gt;status == 1){ return $omniture_variables; }
function my_module_omniture_variables() {
  $current_day = date('D');
  $current_hour = date('G');
  .....

  $omniture_variables['variables'] = array(
    ....
  );

  //Sets omniture variables
  if(module_exists('omniture')) {
  ....
  }
  
  if(count($extra_variables) &gt; 0) {
    $omniture_variables['variables'] = array_merge($omniture_variables['variables'], $extra_variables);
  }

  return $omniture_variables;
}
Getting a node's status is quite simple:

// Get the node with node ID 123.
$node = node_load(123);
// Get its status.
$status = $node-&gt;status;


That said... I don't know what your function looks like or in which context it's running, so depending on your situation, there may be an even better way to get what you want.