function _print_robots_meta_generator in Printer, email and PDF versions 5.3
Same name and namespace in other branches
- 5.4 print.pages.inc \_print_robots_meta_generator()
- 5 print.module \_print_robots_meta_generator()
- 5.2 print.module \_print_robots_meta_generator()
- 6 print.pages.inc \_print_robots_meta_generator()
- 7.2 print.pages.inc \_print_robots_meta_generator()
- 7 print.pages.inc \_print_robots_meta_generator()
- 5.x print.pages.inc \_print_robots_meta_generator()
Generates a robots meta tag to tell them what they may index
Return value
string with the meta robots tag
1 call to _print_robots_meta_generator()
- _print_var_generator in ./
print.pages.inc - Post-processor that fills the array for the template with common details
File
- ./
print.pages.inc, line 86 - Contains the functions to generate Printer-friendly pages.
Code
function _print_robots_meta_generator() {
$print_robots_noindex = variable_get('print_robots_noindex', PRINT_ROBOTS_NOINDEX_DEFAULT);
$print_robots_nofollow = variable_get('print_robots_nofollow', PRINT_ROBOTS_NOFOLLOW_DEFAULT);
$print_robots_noarchive = variable_get('print_robots_noarchive', PRINT_ROBOTS_NOARCHIVE_DEFAULT);
$robots_meta = array();
if (!empty($print_robots_noindex)) {
$robots_meta[] = 'noindex';
}
if (!empty($print_robots_nofollow)) {
$robots_meta[] = 'nofollow';
}
if (!empty($print_robots_noarchive)) {
$robots_meta[] = 'noarchive';
}
if (count($robots_meta) > 0) {
$robots_meta = implode(', ', $robots_meta);
$robots_meta = "<meta name='robots' content='{$robots_meta}' />\n";
}
else {
$robots_meta = '';
}
return $robots_meta;
}