function menu_position_menu_position_condition_content_type in Menu Position 7.2
Same name and namespace in other branches
- 6 plugins/menu_position.content_type.inc \menu_position_menu_position_condition_content_type()
- 7 plugins/menu_position.content_type.inc \menu_position_menu_position_condition_content_type()
Checks if the node is of a certain type.
Parameters
$variables: An array containing each of the variables saved in the database necessary to evaluate this condition of the rule.
Return value
TRUE if condition applies successfully. Otherwise FALSE.
File
- plugins/
menu_position.content_type.inc, line 16 - Provides the "Content type" rule plugin for the Menu Position module.
Code
function menu_position_menu_position_condition_content_type($variables) {
// Check if this is a node page and then what type of node it is.
return $variables['context']['entity_type'] == 'node' && in_array($variables['context']['bundle_name'], $variables['content_type']) ? TRUE : FALSE;
}