function intlinks_is_published in Internal Links 7
Same name and namespace in other branches
- 8 intlinks_hide_bad_links.inc \intlinks_is_published()
- 6 intlinks_hide_bad_links.inc \intlinks_is_published()
- 7.2 intlinks_hide_bad_links.inc \intlinks_is_published()
More efficient way to get node status (un/published) than using node_load().
Parameters
$nid: The node id corresponding to the node status this function returns.
Return value
Value of "status" (1 if published; 0 if not), or FALSE if the db_query call fails for some reason, which means we can add handling to log links as possible errors (no node with $nid exists).
1 call to intlinks_is_published()
- _intlinks_process_bad_link in ./
intlinks_hide_bad_links.inc - Processes regex matches of links for intlinks_hide_bad_filter_process().
File
- ./
intlinks_hide_bad_links.inc, line 28
Code
function intlinks_is_published($nid) {
return db_query("SELECT status FROM {node} WHERE nid = :nid", array(
':nid' => $nid,
))
->fetchField();
}