By nicknickoli on
I'm writing a custom filter and would like to add some debugging information when someone hits "Preview" on the node edit form but am not seeing any way to add a check in my filter?
node.pages.in uses a theme function and sets one parameter on the node for previews- $node->build_mode... define('NODE_BUILD_PREVIEW', 1) or theme('node_preview', $the_cloned_node).
Is there an easy way to grab the node object being passed along with the form in my preview? By prepending some text to the body for my filter or setting a global in theme_node_preview() and checking it in the hook_filter()
Seems like this should be doable?! Thanks
Comments
Implement hook_nodeapi
You can implement hook_nodeapi, and handle your problem when $op = validate
Please have look at: http://api.drupal.org/api/function/hook_nodeapi/5