hooks.txt

来自「php 开发的内容管理系统」· 文本 代码 · 共 503 行 · 第 1/2 页

TXT
503
字号
$article: the article that was deleted$user: the user that deleted the article$reason: the reason the article was deleted'ArticleProtect': before an article is protected$article: the article being protected$user: the user doing the protection$protect: boolean whether this is a protect or an unprotect$reason: Reason for protect$moveonly: boolean whether this is for move only or not'ArticleProtectComplete': after an article is protected$article: the article that was protected$user: the user who did the protection$protect: boolean whether it was a protect or an unprotect$reason: Reason for protect$moveonly: boolean whether it was for move only or not'ArticleSave': before an article is saved$article: the article (object) being saved$user: the user (object) saving the article$text: the new article text$summary: the article summary (comment)$isminor: minor flag$iswatch: watch flag$section: section #'ArticleSaveComplete': after an article is saved$article: the article (object) saved$user: the user (object) who saved the article$text: the new article text$summary: the article summary (comment)$isminor: minor flag$iswatch: watch flag$section: section #'AutoAuthenticate': called to authenticate users on external/environmental means$user: writes user object to this parameter'BadImage': When checking against the bad image list$name: Image name being checked&$bad: Whether or not the image is "bad"Change $bad and return false to override. If an image is "bad", it is notrendered inline in wiki pages or galleries in category pages.'BlockIp': before an IP address or user is blocked$block: the Block object about to be saved$user: the user _doing_ the block (not the one being blocked)'BlockIpComplete': after an IP address or user is blocked$block: the Block object that was saved$user: the user who did the block (not the one being blocked)'DiffViewHeader': called before diff display$diff: DifferenceEngine object that's calling$oldRev: Revision object of the "old" revision (may be null/invalid)$newRev: Revision object of the "new" revision'EditFormPreloadText': Allows population of the edit form when creating new pages&$text: Text to preload with&$title: Title object representing the page being created'EditFilter': Perform checks on an edit$editor: Edit form (see includes/EditPage.php)$text: Contents of the edit box$section: Section being edited&$error: Error message to returnReturn false to halt editing; you'll need to handle error messages, etc. yourself.Alternatively, modifying $error and returning true will cause the contents of $errorto be echoed at the top of the edit form as wikitext. Return true without altering$error to allow the edit to proceed.'EmailConfirmed': When checking that the user's email address is "confirmed"$user: User being checked$confirmed: Whether or not the email address is confirmedThis runs before the other checks, such as anonymity and the real check; returntrue to allow those checks to occur, and false if checking is done.'EmailUser': before sending email from one user to another$to: address of receiving user$from: address of sending user$subject: subject of the mail$text: text of the mail'EmailUserComplete': after sending email from one user to another$to: address of receiving user$from: address of sending user$subject: subject of the mail$text: text of the mail'FetchChangesList': When fetching the ChangesList derivative for a particular user&$user: User the list is being fetched for&$skin: Skin object to be used with the list&$list: List object (defaults to NULL, change it to an object instance and returnfalse override the list derivative used)'GetInternalURL': modify fully-qualified URLs used for squid cache purging$title: Title object of page$url: string value as output (out parameter, can modify)$query: query options passed to Title::getInternalURL()'GetLocalURL': modify local URLs as output into page links$title: Title object of page$url: string value as output (out parameter, can modify)$query: query options passed to Title::getLocalURL()'GetFullURL': modify fully-qualified URLs used in redirects/export/offsite data$title: Title object of page$url: string value as output (out parameter, can modify)$query: query options passed to Title::getFullURL()'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes&$type: array of strings'LogPageLogName': name of the logging page(s). DEPRECATED: Use $wgLogNames&$typeText: array of strings'LogPageLogHeader': strings used by wfMsg as a header. DEPRECATED: Use $wgLogHeaders&$headerText: array of strings'LogPageActionText': strings used by wfMsg as a header. DEPRECATED: Use $wgLogActions&$actionText: array of strings'MarkPatrolled': before an edit is marked patrolled$rcid: ID of the revision to be marked patrolled$user: the user (object) marking the revision as patrolled$wcOnlySysopsCanPatrol: config setting indicating whether the user needs to be a sysop in order to mark an edit patrolled'MarkPatrolledComplete': after an edit is marked patrolled$rcid: ID of the revision marked as patrolled$user: user (object) who marked the edit patrolled$wcOnlySysopsCanPatrol: config setting indicating whether the user must be a sysop to patrol the edit'MathAfterTexvc': after texvc is executed when rendering mathematics$mathRenderer: instance of MathRenderer$errmsg: error message, in HTML (string). Nonempty indicates failure of rendering the formula'OutputPageBeforeHTML': a page has been processed by the parser andthe resulting HTML is about to be displayed.  $parserOutput: the parserOutput (object) that corresponds to the page $text: the text that will be displayed, in HTML (string)'PageRenderingHash': alter the parser cache option hash key  A parser extension which depends on user options should install  this hook and append its values to the key.$hash: reference to a hash key string which can be modified'PersonalUrls': Alter the user-specific navigation links (e.g. "my page,my talk page, my contributions" etc).&$personal_urls: Array of link specifiers (see SkinTemplate.php)&$title: Title object representing the current page'SiteNoticeBefore': Before the sitenotice/anonnotice is composed&$siteNotice: HTML returned as the sitenoticeReturn true to allow the normal method of notice selection/rendering to work,or change the value of $siteNotice and return false to alter it.'SiteNoticeAfter': After the sitenotice/anonnotice is composed&$siteNotice: HTML sitenoticeAlter the contents of $siteNotice to add to/alter the sitenotice/anonnotice.'TitleMoveComplete': after moving an article (title)$old: old title$nt: new title$user: user who did the move$pageid: database ID of the page that's been moved$redirid: database ID of the created redirect'UnknownAction': An unknown "action" has occured (useful for defining		 your own actions)$action: action name$article: article "acted on"'UnwatchArticle': before a watch is removed from an article$user: user watching$article: article object to be removed'UnwatchArticle': after a watch is removed from an article$user: user that was watching$article: article object removed'UploadVerification': additional chances to reject an uploaded filestring $saveName: destination file namestring $tempName: filesystem path to the temporary file for checksstring &$error: output: HTML error to show if upload canceled by returning false'UploadComplete': Upon completion of a file upload$image: Image object representing the file that was uploaded'UserCan': To interrupt/advise the "user can do X to Y article" check$title: Title object being checked against$user : Current user object$action: Action being checked$result: Pointer to result returned if hook returns false. If null is returned, UserCan checks are continued by internal code'UserCreateForm': change to manipulate the login form$template: SimpleTemplate instance for the form'UserLoginComplete': after a user has logged in$user: the user object that was created on login		    'UserLoginForm': change to manipulate the login form$template: SimpleTemplate instance for the form'UserLogout': before a user logs out$user: the user object that is about to be logged out       'UserLogoutComplete': after a user has logged out$user: the user object _after_ logout (won't have name, ID, etc.)'UserRights': After a user's group memberships are changed$user  : User object that was changed$add   : Array of strings corresponding to groups added$remove: Array of strings corresponding to groups removed		      'WatchArticle': before a watch is added to an article$user: user that will watch$article: article object to be watched'WatchArticleComplete': after a watch is added to an article$user: user that watched$article: article object watched'UnwatchArticleComplete': after a watch is removed from an article$user: user that watched$article: article object that was watched'CategoryPageView': before viewing a categorypage in CategoryPage::view$catpage: CategoryPage instance'SkinTemplateContentActions': after building the $content_action array right                              before returning it, see content_action.php in			      the extension module for a demonstration of how			      to use this hook.$content_actions: The array of content actions'BeforePageDisplay': Called just before outputting a page (all kinds of,		     articles, special, history, preview, diff, edit, ...)		     Can be used to set custom CSS/JS$out: OutputPage objectMore hooks might be available but undocumented, you can execute./maintenance/findhooks.php to find hidden one.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?