Manual:Hooks/LogLine

From MediaWiki.org

Jump to: navigation, search
LogLine
Available from version 1.12.0
Processes a single log entry on Special:Log

*Define function:
function fnMyHook( $log_type, $log_action, $title, $paramArray, &$comment, &$revert, $time ) { ... }

*Attach hook:
$wgHooks['LogLine'][] = 'fnMyHook';
Called from: LogEventsList.php

*For more information about attaching hooks, see Manual:Hooks.
*For examples of extensions using this hook, see Category:LogLine extensions.


[edit] Details

  • $log_type: string for the type of log entry (e.g. 'move'). Corresponds to logging.log_type database field.
  • $log_action: string for the type of log action (e.g. 'delete', 'block', 'create2'). Corresponds to logging.log_action database field.
  • $title: Title object that corresponds to logging.log_namespace and logging.log_title database fields.
  • $paramArray: Array of parameters that corresponds to logging.log_params field. Note that only $paramArray[0] appears to contain anything.
  • &$comment: string that corresponds to logging.log_comment database field, and which is displayed in the UI.
  • &$revert: string that is displayed in the UI, similar to $comment.
  • $time: timestamp of the log entry

[edit] Hint

This hook does not get run when the log entry is of the types: move, block, protect, merge, delete, newusers.