CINXE.COM
Manual:Parser functions - MediaWiki
<!doctype html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <base href="https://www.mediawiki.org/wiki/Manual:Parser_functions"> <meta charset="UTF-8"> <title>Manual:Parser functions - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )mediawikiwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"144ce03e-816c-43a2-a6f5-f121aeb62b32","wgCanonicalNamespace":"Manual","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":100,"wgPageName":"Manual:Parser_functions","wgTitle":"Parser functions","wgCurRevisionId":6846788,"wgRevisionId":6846788,"wgArticleId":17997,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["MediaWiki development","Parser extensions","Wiki markup","Customization techniques","Sample code"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Manual:Parser_functions","wgRelevantArticleId":17997,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["autoconfirmed"],"wgRestrictionMove":["autoconfirmed"],"wgNoticeProject":"mediawiki", "wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":20000,"wgTranslatePageTranslation":"source","wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.translate.tag.languages":"ready","ext.pygments":"ready", "skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.translate.edit.documentation.styles":"ready","ext.translate":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.pygments.view","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.translate.pagetranslation.uls","ext.gadget.syntaxhighlight-copy","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","ext.checkUser.clientHints"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.pygments%2Ctranslate%2CwikimediaBadges%7Cext.translate.edit.documentation.styles%7Cext.translate.tag.languages%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:site_name" content="MediaWiki"> <meta property="og:title" content="Manual:Parser functions - MediaWiki"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.mediawiki.org/wiki/Manual:Parser_functions"> <link rel="apple-touch-icon" href="/static/apple-touch/mediawiki.png"> <link rel="icon" href="/static/favicon/mediawiki.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="MediaWiki (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.mediawiki.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.mediawiki.org/wiki/Manual:Parser_functions"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="MediaWiki Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org"> <link rel="dns-prefetch" href="//login.wikimedia.org"> <meta http-equiv="X-Translated-By" content="Google"> <meta http-equiv="X-Translated-To" content="te"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.1hbgkFx4Qn8.O/am=DgY/d=1/rs=AN8SPfqlmAPxwfG457BPbRXwNq39oSMGHg/m=corsproxy" data-sourceurl="https://www.mediawiki.org/wiki/Manual:Parser_functions"></script> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.1hbgkFx4Qn8.O/am=DgY/d=1/exm=corsproxy/ed=1/rs=AN8SPfqlmAPxwfG457BPbRXwNq39oSMGHg/m=phishing_protection" data-phishing-protection-enabled="false" data-forms-warning-enabled="true" data-source-url="https://www.mediawiki.org/wiki/Manual:Parser_functions"></script> <meta name="robots" content="none"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-100 ns-subject page-Manual_Parser_functions rootpage-Manual_Parser_functions skin-vector-2022 action-view"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.1hbgkFx4Qn8.O/am=DgY/d=1/exm=corsproxy,phishing_protection/ed=1/rs=AN8SPfqlmAPxwfG457BPbRXwNq39oSMGHg/m=navigationui" data-environment="prod" data-proxy-url="https://www-mediawiki-org.translate.goog" data-proxy-full-url="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" data-source-url="https://www.mediawiki.org/wiki/Manual:Parser_functions" data-source-language="auto" data-target-language="te" data-display-language="te" data-detected-source-language="en" data-is-source-untranslated="false" data-source-untranslated-url="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://www.mediawiki.org/wiki/Manual:Parser_functions&anno=2" data-client="tr"></script><a class="mw-jump-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right"><input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu"> <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true"><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container"> <div class="vector-pinnable-header-label"> Main menu </div><button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation"> <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/MediaWiki?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li> <li id="n-mw-download" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Download?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Get MediaWiki</span></a></li> <li id="n-mw-extensions" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Category:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Get extensions</span></a></li> <li id="n-blog-text" class="mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://techblog.wikimedia.org/"><span>Tech blog</span></a></li> <li id="n-mw-contribute" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/How_to_contribute?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Contribute</span></a></li> </ul> </div> </div> <div id="p-support" class="vector-menu mw-portlet mw-portlet-support"> <div class="vector-menu-heading"> Support </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Contents?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="The place to find out"><span>User help</span></a></li> <li id="n-mw-faq" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:FAQ?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>FAQ</span></a></li> <li id="n-mw-manual" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Contents?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Technical manual</span></a></li> <li id="n-mw-supportdesk" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Project:Support_desk?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Support desk</span></a></li> <li id="n-mw-communication" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Communication?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Communication</span></a></li> </ul> </div> </div> <div id="p-development" class="vector-menu mw-portlet mw-portlet-development"> <div class="vector-menu-heading"> Development </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mw-developerportal" class="mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://developer.wikimedia.org/"><span>Developer portal</span></a></li> <li id="n-svn-statistics" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Development_statistics?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Code statistics</span></a></li> </ul> </div> </div> <div id="p-mediawiki.org" class="vector-menu mw-portlet mw-portlet-mediawiki_org"> <div class="vector-menu-heading"> mediawiki.org </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Project:Help?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li> <li id="n-recentchanges" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:RecentChanges?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li> <li id="n-mw-translate" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:LanguageStats?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Translate content</span></a></li> <li id="n-randompage" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:Random?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li> <li id="n-mw-discussion" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Project:Village_Pump?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Village pump</span></a></li> <li id="n-Sandboxlink-portlet-label" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Project:Sandbox?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Sandbox</span></a></li> </ul> </div> </div> <div id="p-lang" class="vector-menu mw-portlet mw-portlet-lang"> <div class="vector-menu-heading"> In other languages </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"> <span class="wb-langlinks-add wb-langlinks-link"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://www.wikidata.org/wiki/Special:NewItem?site%3Dmediawikiwiki%26page%3DManual%253AParser%2Bfunctions" title="Add interlanguage links" class="wbc-editpage">Add links</a></span> </div> </div> </div> </div> </div> </div> </div> </nav><a href="https://www-mediawiki-org.translate.goog/wiki/MediaWiki?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/mediawikiwiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="MediaWiki" src="/static/images/mobile/copyright/mediawikiwiki-wordmark.svg" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:Search?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search MediaWiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"><input class="cdx-text-input__input" type="search" name="search" placeholder="Search MediaWiki" aria-label="Search MediaWiki" autocapitalize="sentences" title="Search MediaWiki [f]" accesskey="f" id="searchInput"> <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div><input type="hidden" name="title" value="Special:Search"> </div><button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a></li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color"><input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance"> <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true"><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://donate.wikimedia.org/?utm_source%3Ddonate%26utm_medium%3Dsidebar%26utm_campaign%3Dspontaneous%26uselang%3Den" class=""><span>Donate</span></a></li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:CreateAccount&returnto=Manual:Parser+functions&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a></li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:UserLogin&returnto=Manual:Parser+functions&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a></li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="More options"><input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools"> <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true"><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://donate.wikimedia.org/?utm_source%3Ddonate%26utm_medium%3Dsidebar%26utm_campaign%3Dspontaneous%26uselang%3Den"><span>Donate</span></a></li> <li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:CreateAccount&returnto=Manual:Parser+functions&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li> <li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:UserLogin&returnto=Manual:Parser+functions&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor"> <div class="vector-menu-heading"> Pages for logged out editors <a href="https://www-mediawiki-org.translate.goog/wiki/Help:Introduction?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyContributions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li> <li id="pt-anontalk" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyTalk?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"> <!-- CentralNotice --> </div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc"> <h2 class="vector-pinnable-header-label">Contents</h2><button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#" class="vector-toc-link"> <div class="vector-toc-text"> Beginning </div></a></li> <li id="toc-Description" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Description"> <div class="vector-toc-text"><span class="vector-toc-numb">1</span> <span>Description</span> </div></a> <ul id="toc-Description-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Simple_example" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Simple_example"> <div class="vector-toc-text"><span class="vector-toc-numb">2</span> <span>Simple example</span> </div></a> <button aria-controls="toc-Simple_example-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Simple example subsection</span> </button> <ul id="toc-Simple_example-sublist" class="vector-toc-list"> <li id="toc-Within_LocalSettings.php" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Within_LocalSettings.php"> <div class="vector-toc-text"><span class="vector-toc-numb">2.1</span> <span>Within LocalSettings.php</span> </div></a> <ul id="toc-Within_LocalSettings.php-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Longer_functions" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Longer_functions"> <div class="vector-toc-text"><span class="vector-toc-numb">2.2</span> <span>Longer functions</span> </div></a> <ul id="toc-Longer_functions-sublist" class="vector-toc-list"> </ul></li> </ul></li> <li id="toc-Parser_interface" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Parser_interface"> <div class="vector-toc-text"><span class="vector-toc-numb">3</span> <span>Parser interface</span> </div></a> <button aria-controls="toc-Parser_interface-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Parser interface subsection</span> </button> <ul id="toc-Parser_interface-sublist" class="vector-toc-list"> <li id="toc-Controlling_the_parsing_of_output" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Controlling_the_parsing_of_output"> <div class="vector-toc-text"><span class="vector-toc-numb">3.1</span> <span>Controlling the parsing of output</span> </div></a> <ul id="toc-Controlling_the_parsing_of_output-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Naming" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Naming"> <div class="vector-toc-text"><span class="vector-toc-numb">3.2</span> <span>Naming</span> </div></a> <ul id="toc-Naming-sublist" class="vector-toc-list"> </ul></li> <li id="toc-The_setFunctionHook_hook" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#The_setFunctionHook_hook"> <div class="vector-toc-text"><span class="vector-toc-numb">3.3</span> <span>The setFunctionHook hook</span> </div></a> <ul id="toc-The_setFunctionHook_hook-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Expensive_parser_functions" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Expensive_parser_functions"> <div class="vector-toc-text"><span class="vector-toc-numb">3.4</span> <span>Expensive parser functions</span> </div></a> <ul id="toc-Expensive_parser_functions-sublist" class="vector-toc-list"> </ul></li> </ul></li> <li id="toc-Named_parameters" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Named_parameters"> <div class="vector-toc-text"><span class="vector-toc-numb">4</span> <span>Named parameters</span> </div></a> <ul id="toc-Named_parameters-sublist" class="vector-toc-list"> </ul></li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#See_also"> <div class="vector-toc-text"><span class="vector-toc-numb">5</span> <span>See also</span> </div></a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul></li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left"><input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents"> <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true"><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Manual</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Parser functions</span></h1> <div class="mw-indicators"> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-manual" class="selected vector-tab-noicon mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="View the subject page [c]" accesskey="c"><span>Manual</span></a></li> <li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual_talk:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" rel="discussion" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet"><input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant"> <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true"><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Read</span></a></li> <li id="ca-viewsource" class="vector-tab-noicon mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&action=edit&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li> <li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&action=history&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown"><input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools"> <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true"><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container"> <div class="vector-pinnable-header-label"> Tools </div><button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options"> <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Read</span></a></li> <li id="ca-more-viewsource" class="vector-more-collapsible-item mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&action=edit&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>View source</span></a></li> <li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&action=history&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb"> <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:WhatLinksHere/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li> <li id="t-recentchangeslinked" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:RecentChangesLinked/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li> <li id="t-upload" class="mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://commons.wikimedia.org/wiki/Special:UploadWizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li> <li id="t-specialpages" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:SpecialPages?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li> <li id="t-permalink" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&oldid=6846788&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li> <li id="t-info" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&action=info&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="More information about this page"><span>Page information</span></a></li> <li id="t-cite" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:CiteThisPage&page=Manual:Parser_functions&id=6846788&wpFormIdentifier=titleform&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Information on how to cite this page"><span>Cite this page</span></a></li> <li id="t-urlshortener" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:UrlShortener&url=https://www.mediawiki.org/wiki/Manual:Parser_functions&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Get shortened URL</span></a></li> <li id="t-urlshortener-qrcode" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:QrCode&url=https://www.mediawiki.org/wiki/Manual:Parser_functions&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export"> <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:Book&bookcmd=book_creator&referer=Manual:Parser+functions&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Create a book</span></a></li> <li id="coll-download-as-rl" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:DownloadAsPdf&page=Manual:Parser_functions&action=show-download-screen&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te"><span>Download as PDF</span></a></li> <li id="t-print" class="mw-list-item"><a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&printable=yes&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects emptyPortlet"> <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container"> <div class="vector-pinnable-header-label"> Appearance </div><button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div id="siteSub" class="noprint"> From mediawiki.org </div> </div> <div id="contentSub"> <div id="mw-content-subtitle"></div> </div> <div id="mw-content-text" class="mw-body-content"> <div class="mw-pt-translate-header noprint nomobile" dir="ltr" lang="en"> <a href="https://www-mediawiki-org.translate.goog/w/index.php?title=Special:Translate&group=page-Manual:Parser+functions&action=page&filter&action_source=translate_page&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:Translate">Translate this page</a> </div> <div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"> <div class="mw-pt-languages noprint navigation-not-searchable" lang="en" dir="ltr"> <div class="mw-pt-languages-label"> Languages: </div> <ul class="mw-pt-languages-list"> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/id?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Pedoman:Fungsi parser (17% translated)" lang="id" dir="ltr">Bahasa Indonesia</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/de?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:Parser-Funktionen (34% translated)" lang="de" dir="ltr">Deutsch</a></li> <li><span class="mw-pt-languages-ui mw-pt-languages-selected mw-pt-progress mw-pt-progress--complete" lang="en" dir="ltr">English</span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/eo?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manlibro:Sintaksanalizilaj funkcioj (7% translated)" lang="eo" dir="ltr">Esperanto</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/dtp?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manual:Parser functions/dtp (4% translated)" lang="dtp" dir="ltr">Kadazandusun</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/nl?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--complete" title="Handboek:Parserfuncties (100% translated)" lang="nl" dir="ltr">Nederlands</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/vi?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Hướng dẫn:Hàm phân tích cú pháp (32% translated)" lang="vi" dir="ltr">Tiếng Việt</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/tr?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:Ayrıştırıcı işlevleri (40% translated)" lang="tr" dir="ltr">Türkçe</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/da?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:Parser functions/da (25% translated)" lang="da" dir="ltr">dansk</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/es?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--complete" title="Manual:Funciones del analizador sintáctico (100% translated)" lang="es" dir="ltr">español</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/fr?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--complete" title="Fonctions d'analyse (100% translated)" lang="fr" dir="ltr">français</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/pl?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Podręcznik:Funkcje parsera (6% translated)" lang="pl" dir="ltr">polski</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/pt?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manual:Funções do Analisador (12% translated)" lang="pt" dir="ltr">português</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/pt-br?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manual:Funções do analisador sintático (4% translated)" lang="pt-BR" dir="ltr">português do Brasil</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/sv?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manual:Parserfunktioner (1% translated)" lang="sv" dir="ltr">svenska</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/cs?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--complete" title="Příručka:Parsovací funkce (100% translated)" lang="cs" dir="ltr">čeština</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/ru?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Руководство:Функции парсера (66% translated)" lang="ru" dir="ltr">русский</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/ar?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--complete" title="دليل:دوال المحلل اللغوي (100% translated)" lang="ar" dir="rtl">العربية</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/th?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="คู่มือการใช้:พาร์เซอร์ฟังก์ชัน (3% translated)" lang="th" dir="ltr">ไทย</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/zh?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:解析器函数 (37% translated)" lang="zh" dir="ltr">中文</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/ja?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:パーサー関数 (63% translated)" lang="ja" dir="ltr">日本語</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions/ko?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="메뉴얼:파서 함수 (10% translated)" lang="ko" dir="ltr">한국어</a></li> </ul> </div> <style data-mw-deduplicate="TemplateStyles:r6651103">.mw-parser-output .nmbox{background:#f8f9fa;border:1px solid #AAA;box-sizing:border-box;margin:2px 0;padding:0}.mw-parser-output .nmbox *{box-sizing:border-box}.mw-parser-output .nmbox-header{background:#eaecf0;padding:4px 0.5em;font-weight:bold;text-align:center;white-space:nowrap}.mw-parser-output .nmbox .mbox-image{display:inline-block;padding-right:1em}.mw-parser-output .nmbox-text{border-top:1px solid #AAA;width:100%;padding:4px 0.5em}@media screen and (min-width:768px){.mw-parser-output .nmbox-header{display:table-cell;border-right:1px solid #AAA;width:1%}.mw-parser-output .nmbox-text{border-top:none;display:table-cell}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .nmbox-header,html.skin-theme-clientpref-night .mw-parser-output .nmbox{background:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .nmbox-header,html.skin-theme-clientpref-os .mw-parser-output .nmbox{background:transparent;color:inherit}}</style> <div class="nmbox noprint mw-content-ltr"> <div class="nmbox-header"> <div class="nmbox-image mbox-image"> <span class="skin-invert" typeof="mw:File"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Extensions"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/f/fb/OOjs_UI_icon_puzzle-ltr.svg/20px-OOjs_UI_icon_puzzle-ltr.svg.png" decoding="async" width="20" height="20" class="mw-file-element" srcset="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/OOjs_UI_icon_puzzle-ltr.svg/30px-OOjs_UI_icon_puzzle-ltr.svg.png 1.5x,https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/OOjs_UI_icon_puzzle-ltr.svg/40px-OOjs_UI_icon_puzzle-ltr.svg.png 2x" data-file-width="20" data-file-height="20"></a></span> </div><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Extensions">Extensions:</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Extensions"> </a></span></b> </div> <div class="nmbox-text mbox-text"> <style data-mw-deduplicate="TemplateStyles:r6387430">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li,.mw-parser-output .hlist .mw-empty-elt{display:none}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)"\a0 "}</style> <div class="hlist"> <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Developing extensions">Development</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Developing extensions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Tag_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Tag extensions">Tag extensions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Tag_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Tag extensions"> </a></span></li> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser functions">Parser functions</a></b><span style="display:none"><a class="mw-selflink selflink"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Hooks">Hooks</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Hooks?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Hooks"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Special_pages?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Special pages">Special pages</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Special_pages?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Special pages"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Skins?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Skins">Skins</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Skins?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Skins"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Magic_words?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Magic words">Magic words</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Magic_words?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Magic words"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/API:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/API:Extensions">API</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/API:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="API:Extensions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Page_content_models?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Page content models">Content models</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Page_content_models?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Page content models"> </a></span></li> </ul> </div> </div> </div> <figure class="mw-halign-right" typeof="mw:File"> <a href="https://www-mediawiki-org.translate.goog/wiki/File:MediaWiki-extensions-icon.svg?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="mw-file-description"><img alt="MediaWiki extensions" src="//upload.wikimedia.org/wikipedia/commons/thumb/2/23/MediaWiki-extensions-icon.svg/125px-MediaWiki-extensions-icon.svg.png" decoding="async" width="125" height="84" class="mw-file-element" srcset="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://upload.wikimedia.org/wikipedia/commons/thumb/2/23/MediaWiki-extensions-icon.svg/188px-MediaWiki-extensions-icon.svg.png 1.5x,https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://upload.wikimedia.org/wikipedia/commons/thumb/2/23/MediaWiki-extensions-icon.svg/250px-MediaWiki-extensions-icon.svg.png 2x" data-file-width="686" data-file-height="463"></a> <figcaption></figcaption> </figure> <p>Parser functions, added in MediaWiki 1.7, are a type of extension that integrate closely with the parser. The phrase "parser function" should not be confused with <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension:ParserFunctions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Extension:ParserFunctions">Extension:ParserFunctions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension:ParserFunctions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Extension:ParserFunctions"> </a></span>, which is a collection of simple parser functions. (See <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Extension:ParserFunctions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Help:Extension:ParserFunctions">Help:Extension:ParserFunctions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Help:Extension:ParserFunctions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Help:Extension:ParserFunctions"> </a></span> for those.)</p> <meta property="mw:PageProp/toc"> <div class="mw-heading mw-heading2"> <h2 id="Description">Description</h2> </div> <p>Whereas a <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Tag_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Tag extensions">tag extension</a> is expected to take unprocessed text and return HTML to the browser, a parser function can 'interact' with other wiki elements in the page. For example, the output of a parser function could be used as a <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Templates?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Parameters" title="Special:MyLanguage/Help:Templates">template parameter</a> or in the construction of a <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Link?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Help:Link">link</a>.</p> <p>The typical syntax for a parser function is:</p> <blockquote> <p>{{ #functionname: param1 | param2 | param3 }}</p> </blockquote> <p>For more information, see <span class="plainlinks"><a class="external text" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://doc.wikimedia.org/mediawiki-core/master/php/classParser.html%23a501ce7bb8f461a1b5fbd9f05970cab67">the documentation</a></span> for <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nx">Parser</span><span class="o">::</span><span class="na">setFunctionHook</span> <span class="p">(</span> <span class="nv">$id</span><span class="p">,</span> <span class="nv">$callback</span><span class="p">,</span> <span class="nv">$flags</span> <span class="o">=</span> <span class="mi">0</span> <span class="p">)</span></code>. This documentation states:</p> <dl> <dd> The callback function should have the form: <dl> <dd> <code>function myParserFunction( $parser, $arg1, $arg2, $arg3 ) { ... }</code> </dd> </dl> </dd> <dd> Or with <code>SFH_OBJECT_ARGS</code>: <dl> <dd> <code>function myParserFunction( $parser, $frame, $args ) { ... }</code> </dd> </dl> </dd> </dl> <p>The first variant of the call passes all arguments as plain text. The second passes all arguments as an array of <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:PPNode.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:PPNode.php">PPNode</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:PPNode.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:PPNode.php"> </a></span>s, except for the first (<code>$args[0]</code>), which is currently text, though this may change in the future. These represent the unexpanded wikitext. The <code><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:PPFrame.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:PPFrame.php">$frame</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:PPFrame.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:PPFrame.php"> </a></span></code> parameter can be used to expand these arguments as needed. This is commonly used for conditional processing so that only the <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> case is evaluated with an <code>if-</code> or <code>switch-like</code> parser function. The frame object can also climb up the document tree to get information about the caller and has functions to determine and manage call depth, time-to-live, and whether the result of the parser function is volatile.</p> <p>Creating a parser function is slightly more complicated than creating a new tag because the function name must be a <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Magic_words?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Help:Magic words">magic word</a>, a keyword that supports aliases and localization.</p> <div class="mw-heading mw-heading2"> <h2 id="Simple_example">Simple example</h2> </div> <p>Below is an example of an extension that creates a parser function.</p> <p>The registration goes into <b>extension.json</b> and the code into <b>src/ExampleExtensionHooks.php</b> respectively:</p> <table class="wikitable"> <tbody> <tr> <th>Standard:</th> <th>Using the HookHandler interface:</th> </tr> <tr> <td colspan="2"><b>extension.json</b></td> </tr> <tr> <td> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"> <pre><span></span><span class="p">{</span> <span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ExampleExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Me"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1.0.0"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://www.mediawiki.org/wiki/Extension:ExampleExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"descriptionmsg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"exampleextension-desc"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"license-name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"GPL-2.0-or-later"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"parserhook"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"MessagesDirs"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtension"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"i18n"</span> <span class="w"> </span><span class="p">]</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"AutoloadClasses"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtensionHooks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"src/ExampleExtensionHooks.php"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"ExtensionMessagesFiles"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtensionMagic"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ExampleExtension.i18n.php"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"Hooks"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ParserFirstCallInit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ExampleExtensionHooks::onParserFirstCallInit"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"manifest_version"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span> <span class="p">}</span> </pre> </div></td> <td> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"> <pre><span></span><span class="p">{</span> <span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ExampleExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Me"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1.0.0"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://www.mediawiki.org/wiki/Extension:ExampleExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"descriptionmsg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"exampleextension-desc"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"license-name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"GPL-2.0-or-later"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"parserhook"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"MessagesDirs"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtension"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"i18n"</span> <span class="w"> </span><span class="p">]</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"AutoloadClasses"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtensionHooks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"src/ExampleExtensionHooks.php"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"ExtensionMessagesFiles"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtensionMagic"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ExampleExtension.i18n.php"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"Hooks"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ParserFirstCallInit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"onParserFirstCallInit"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"HookHandlers"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtensionHooks"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"class"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MediaWiki\\Extension\\ExampleExtension\\Hooks"</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"manifest_version"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span> <span class="p">}</span> </pre> </div></td> </tr> <tr> <td colspan="2"><b>ExampleExtensionHooks.php</b></td> </tr> <tr> <td> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="cp"><?php</span> <span class="k">class</span> <span class="nc">ExampleExtensionHooks</span> <span class="p">{</span> <span class="c1">// Register any render callbacks with the parser</span> <span class="k">public</span> <span class="k">static</span> <span class="k">function</span> <span class="nf">onParserFirstCallInit</span><span class="p">(</span> <span class="nx">Parser</span> <span class="nv">$parser</span> <span class="p">)</span> <span class="p">{</span> <span class="c1">// Create a function hook associating the <code>example</code> magic word with renderExample()</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">setFunctionHook</span><span class="p">(</span> <span class="s1">'example'</span><span class="p">,</span> <span class="p">[</span> <span class="nx">self</span><span class="o">::</span><span class="na">class</span><span class="p">,</span> <span class="s1">'renderExample'</span> <span class="p">]</span> <span class="p">);</span> <span class="p">}</span> <span class="c1">// Render the output of {{#example:}}.</span> <span class="k">public</span> <span class="k">static</span> <span class="k">function</span> <span class="nf">renderExample</span><span class="p">(</span> <span class="nx">Parser</span> <span class="nv">$parser</span><span class="p">,</span> <span class="nv">$param1</span> <span class="o">=</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$param2</span> <span class="o">=</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$param3</span> <span class="o">=</span> <span class="s1">''</span> <span class="p">)</span> <span class="p">{</span> <span class="c1">// The input parameters are wikitext with templates expanded.</span> <span class="c1">// The output should be wikitext too.</span> <span class="nv">$output</span> <span class="o">=</span> <span class="s2">"param1 is </span><span class="si">$param1</span><span class="s2"> and param2 is </span><span class="si">$param2</span><span class="s2"> and param3 is </span><span class="si">$param3</span><span class="s2">"</span><span class="p">;</span> <span class="k">return</span> <span class="nv">$output</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> </pre> </div></td> <td> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="cp"><?php</span> <span class="k">class</span> <span class="nc">ExampleExtensionHooks</span> <span class="k">implements</span> <span class="nx">ParserFirstCallInitHook</span> <span class="p">{</span> <span class="c1">// Register any render callbacks with the parser</span> <span class="k">public</span> <span class="k">function</span> <span class="nf">onParserFirstCallInit</span><span class="p">(</span> <span class="nv">$parser</span> <span class="p">)</span> <span class="p">{</span> <span class="c1">// Create a function hook associating the <code>example</code> magic word with renderExample()</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">setFunctionHook</span><span class="p">(</span> <span class="s1">'example'</span><span class="p">,</span> <span class="p">[</span> <span class="nv">$this</span><span class="p">,</span> <span class="s1">'renderExample'</span> <span class="p">]</span> <span class="p">);</span> <span class="p">}</span> <span class="c1">// Render the output of {{#example:}}.</span> <span class="k">public</span> <span class="k">function</span> <span class="nf">renderExample</span><span class="p">(</span> <span class="nv">$parser</span><span class="p">,</span> <span class="nv">$param1</span> <span class="o">=</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$param2</span> <span class="o">=</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$param3</span> <span class="o">=</span> <span class="s1">''</span> <span class="p">)</span> <span class="p">{</span> <span class="c1">// The input parameters are wikitext with templates expanded.</span> <span class="c1">// The output should be wikitext too.</span> <span class="nv">$output</span> <span class="o">=</span> <span class="s2">"param1 is </span><span class="si">$param1</span><span class="s2"> and param2 is </span><span class="si">$param2</span><span class="s2"> and param3 is </span><span class="si">$param3</span><span class="s2">"</span><span class="p">;</span> <span class="k">return</span> <span class="nv">$output</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> </pre> </div></td> </tr> </tbody> </table> <p>Another file, <b>ExampleExtension.i18n.php</b>, in your extension directory (Not in the src/ subdirectory) should contain:</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="cp"><?php</span> <span class="sd">/**</span> <span class="sd"> * @license GPL-2.0-or-later</span> <span class="sd"> * @author Your Name (YourUserName)</span> <span class="sd"> */</span> <span class="nv">$magicWords</span> <span class="o">=</span> <span class="p">[];</span> <span class="sd">/** English</span> <span class="sd"> * @author Your Name (YourUserName)</span> <span class="sd"> */</span> <span class="nv">$magicWords</span><span class="p">[</span><span class="s1">'en'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> <span class="s1">'example'</span> <span class="o">=></span> <span class="p">[</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">'example'</span> <span class="p">],</span> <span class="p">];</span> </pre> </div> <p>With this extension enabled,</p> <ul> <li>{{#example: hello | hi | hey}}</li> </ul> <p>produces:</p> <ul> <li>param1 is hello and param2 is hi and param3 is hey</li> </ul> <style data-mw-deduplicate="TemplateStyles:r6651107">.mw-parser-output .note{background-position:left 7px top 50%;padding:0.5em 0.5em 0.5em 40px;margin:0.5em 0;overflow:hidden;background-color:#f8f9fa;color:#333;background-repeat:no-repeat;border:1px solid #ddd}.mw-parser-output .note-inline{display:inline-block;vertical-align:middle}.mw-parser-output .note-info{background-color:#eaf3ff;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/e/ec/OOjs_UI_icon_information-progressive.svg");background-size:25px;border-color:#a3caff;padding-left:40px;min-height:25px}.mw-parser-output .note-reminder{background-color:#fff9ea;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/a/a8/OOjs_UI_icon_lightbulb-yellow.svg");background-size:25px;border-color:#fc3;min-height:25px}.mw-parser-output .note-warn{background-color:#fff9ea;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/3/3b/OOjs_UI_icon_alert-warning.svg");background-size:25px;border-color:#fc3;min-height:25px}.mw-parser-output .note-error{background-color:#fee7e6;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/b/bf/OOjs_UI_icon_notice-destructive.svg");background-size:25px;border-color:#c33;min-height:25px}@media screen{html.skin-theme-clientpref-night .mw-parser-output .note{background-color:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .note{background-color:transparent;color:inherit}}</style> <div role="note" class="note note-info"> This magicWords array is not optional. If it is omitted, the parser function simply will not work; the {{#example: hello | hi}} will be rendered as though the extension were not installed. If only the language-specific array is initialized and not the magicWords array itself, this can cause localization errors as translations from other extensions leak into yours. You can associate magic words inline in PHP rather than through a i18n file. This is useful when defining hooks in <code>LocalSettings.php</code> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="nx">MediaWiki\MediaWikiServices</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-></span><span class="na">getContentLanguage</span><span class="p">()</span><span class="o">-></span><span class="na">mMagicExtensions</span><span class="p">[</span><span class="s1">'wikicodeToHtml'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'MAG_CUSTOM'</span><span class="p">,</span> <span class="s1">'custom'</span><span class="p">];</span> </pre> </div> </div> <div class="mw-heading mw-heading3"> <h3 id="Within_LocalSettings.php">Within LocalSettings.php</h3> </div> <p>Magic words and their handling parser functions can be defined entirely in LocalSettings.php.</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="nv">$wgHooks</span><span class="p">[</span><span class="s1">'ParserFirstCallInit'</span><span class="p">][]</span> <span class="o">=</span> <span class="k">function</span> <span class="p">(</span> <span class="nx">Parser</span> <span class="nv">$parser</span> <span class="p">)</span> <span class="p">{</span> <span class="nx">MediaWiki\MediaWikiServices</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-></span><span class="na">getContentLanguage</span><span class="p">()</span><span class="o">-></span><span class="na">mMagicExtensions</span><span class="p">[</span><span class="s1">'wikicodeToHtml'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'wikicodeToHtml'</span><span class="p">,</span> <span class="s1">'wikicodeToHtml'</span><span class="p">];</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">setFunctionHook</span><span class="p">(</span> <span class="s1">'wikicodeToHtml'</span><span class="p">,</span> <span class="s1">'wikicodeToHtml'</span> <span class="p">);</span> <span class="p">};</span> <span class="k">function</span> <span class="nf">wikicodeToHtml</span><span class="p">(</span> <span class="nx">Parser</span> <span class="nv">$parser</span><span class="p">,</span> <span class="nv">$code</span> <span class="o">=</span> <span class="s1">''</span> <span class="p">)</span> <span class="p">{</span> <span class="nv">$title</span> <span class="o">=</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">getTitle</span><span class="p">();</span> <span class="nv">$options</span> <span class="o">=</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">Options</span><span class="p">();</span> <span class="nv">$options</span><span class="o">-></span><span class="na">enableLimitReport</span><span class="p">(</span><span class="k">false</span><span class="p">);</span> <span class="nv">$parser</span> <span class="o">=</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">getFreshParser</span><span class="p">();</span> <span class="k">return</span> <span class="p">[</span><span class="nv">$parser</span><span class="o">-></span><span class="na">parse</span><span class="p">(</span><span class="nv">$code</span><span class="p">,</span> <span class="nv">$title</span><span class="p">,</span> <span class="nv">$options</span><span class="p">)</span><span class="o">-></span><span class="na">getText</span><span class="p">(),</span> <span class="s1">'isHTML'</span> <span class="o">=></span> <span class="k">true</span><span class="p">];</span> <span class="p">}</span> </pre> </div> <div class="mw-heading mw-heading3"> <h3 id="Longer_functions">Longer functions</h3> </div> <p>For longer functions, you may want to split the hook functions out to a _body.php or .hooks.php file and make them static functions of a class. Then you can load the class with <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:$wgAutoloadClasses?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:$wgAutoloadClasses">$wgAutoloadClasses</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:$wgAutoloadClasses?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:$wgAutoloadClasses"> </a></span> and call the static functions in the hooks; e.g.:</p> <p>Put this in your <code>extension.json</code> file:</p> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"> <pre><span></span><span class="nt">"Hooks"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ParserFirstCallInit"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ExampleExtensionHooks::onParserFirstCallInit"</span> <span class="p">},</span> <span class="nt">"AutoloadClasses"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ExampleExtensionHooks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"src/ExampleExtensionHooks.php"</span> <span class="p">}</span> </pre> </div> <ul> <li><small>See: <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Writing_an_event_handler" title="Special:MyLanguage/Manual:Hooks">writing an event handler</a> for other styles.</small></li> </ul> <p>Then put this in your <code>src/ExampleExtensionHooks.php</code> file:</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="k">class</span> <span class="nc">ExampleExtensionHooks</span> <span class="p">{</span> <span class="k">public</span> <span class="k">static</span> <span class="k">function</span> <span class="nf">onParserFirstCallInit</span><span class="p">(</span> <span class="nx">Parser</span> <span class="nv">$parser</span> <span class="p">)</span> <span class="p">{</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">setFunctionHook</span><span class="p">(</span> <span class="s1">'example'</span><span class="p">,</span> <span class="p">[</span> <span class="nx">self</span><span class="o">::</span><span class="na">class</span><span class="p">,</span> <span class="s1">'renderExample'</span> <span class="p">]</span> <span class="p">);</span> <span class="p">}</span> <span class="p">}</span> </pre> </div> <p><br></p> <div class="mw-heading mw-heading2"> <h2 id="Parser_interface">Parser interface</h2> </div> <div class="mw-heading mw-heading3"> <h3 id="Controlling_the_parsing_of_output">Controlling the parsing of output</h3> </div> <p>To have the wikitext returned by your parser function be fully parsed (including expansion of templates), set the <code>noparse</code> option to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code> when returning:</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="k">return</span> <span class="p">[</span> <span class="nv">$output</span><span class="p">,</span> <span class="s1">'noparse'</span> <span class="o">=></span> <span class="k">false</span> <span class="p">];</span> </pre> </div> <p>It seems the default value for <code>noparse</code> changed from <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code> to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code>, at least in some situations, sometime around version 1.12.</p> <p>Conversely, to have your parser function return HTML that remains unparsed, rather than returning wikitext, use this:</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="k">return</span> <span class="p">[</span> <span class="nv">$output</span><span class="p">,</span> <span class="s1">'noparse'</span> <span class="o">=></span> <span class="k">true</span><span class="p">,</span> <span class="s1">'isHTML'</span> <span class="o">=></span> <span class="k">true</span> <span class="p">];</span> </pre> </div> <div class="mw-heading mw-heading3"> <h3 id="Naming">Naming</h3> </div> <p>By default, MW adds a hash character (number sign, <code>#</code>) to the name of each parser function. To suppress that addition (and obtain a parser function with no <code>#</code> prefix), include the <i>SFH_NO_HASH</i> constant in the optional flags argument to setFunctionHook, as described <a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#The_setFunctionHook_hook">below</a>.</p> <p>When choosing a name without a hash prefix, note that transclusion of a page with a name starting with that function name followed by a colon is no longer possible. In particular, avoid function names equal to a namespace name. In the case that interwiki transclusion <a class="external autonumber" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://lists.wikimedia.org/hyperkitty/list/mediawiki-l@lists.wikimedia.org/thread/3M53FBQ66B4EZNU6XMJQRFG3TVCW7WQO/">[1]</a> is enabled, also avoid function names equal to an interwiki prefix.</p> <div class="mw-heading mw-heading3"> <h3 id="The_setFunctionHook_hook">The setFunctionHook hook</h3> </div> <p>For more details of the interface into the parser, see the documentation for setFunctionHook in includes/Parser.php. Here's a (possibly dated) copy of those comments:</p> <p><b>function setFunctionHook( $id, $callback, $flags = 0 )</b></p> <p><b>Parameters:</b></p> <ul> <li>string $id - The magic word ID</li> <li>mixed $callback - The callback function (and object) to use</li> <li>integer $flags - Optional. Values:</li> </ul> <dl> <dd> <ul> <li><i>SFH_NO_HASH</i> (1) constant if you call the function without <code>#</code>.</li> <li><i>SFH_OBJECT_ARGS</i> (2) if you pass a PPFrame object and array of arguments instead of a series of function arguments, for which <a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#Description">see above</a>.</li> <li>Defaults to 0 (no flags).</li> </ul> </dd> </dl> <p><b>Return value:</b> The old callback function for this name, if any</p> <p>Create a function, e.g., <code>{{#sum:1|2|3}}</code>. The callback function should have the form:</p> <div style="overflow:auto;" class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="k">function</span> <span class="nf">myParserFunction</span><span class="p">(</span> <span class="nv">$parser</span><span class="p">,</span> <span class="nv">$arg1</span><span class="p">,</span> <span class="nv">$arg2</span><span class="p">,</span> <span class="nv">$arg3</span> <span class="p">)</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre> </div> <p>The callback may either return the text result of the function, or an array with the text in element 0, and a number of flags in the other elements. The names of the flags are specified in the keys. Valid flags are:</p> <table class="wikitable"> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th>Description</th> </tr> <tr> <td>found</td> <td>Boolean</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code></td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if the text returned is valid and processing of the template must stop.</td> </tr> <tr> <td>text</td> <td>?</td> <td>?</td> <td>The text to return from the function. If isChildObj or isLocalObj are specified, this should be a DOM node instead.</td> </tr> <tr> <td>noparse</td> <td>Boolean</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code></td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if text should not be preprocessed to a DOM tree, e.g. unsafe HTML tags should not be stripped, etc.</td> </tr> <tr> <td>isHTML</td> <td>Boolean</td> <td>?</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if the returned text is HTML and must be armoured against wikitext transformation. <a href="https://www-mediawiki-org.translate.goog/wiki/Manual_talk:Parser_functions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te#isHTML_-_almost_but_not_entirely" title="Manual talk:Parser functions">But see discussion</a></td> </tr> <tr> <td>nowiki</td> <td>Boolean</td> <td>usually <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code></td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if wiki markup in the return value (text) should be escaped.</td> </tr> <tr> <td>isChildObj</td> <td>Boolean</td> <td>?</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if the text is a DOM node needing expansion in a child frame.</td> </tr> <tr> <td>isLocalObj</td> <td>Boolean</td> <td>?</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if the text is a DOM node needing expansion in the current frame. The default value depends on other values and outcomes.</td> </tr> <tr> <td>preprocessFlags</td> <td>?</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code></td> <td>Optional <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:PPFrame.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:PPFrame.php">PPFrame</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:PPFrame.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:PPFrame.php"> </a></span> flags to use when parsing the returned text. This only applies when noparse is <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>.</td> </tr> <tr> <td>title</td> <td>?</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code></td> <td>The <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Title.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Title.php">Title</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Title.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Title.php"> </a></span> object where the text came from.</td> </tr> <tr> <td>forceRawInterwiki</td> <td>Boolean</td> <td>?</td> <td><code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code> if interwiki transclusion must be forced to be done in raw mode and not rendered.</td> </tr> </tbody> </table> <div class="mw-heading mw-heading3"> <h3 id="Expensive_parser_functions">Expensive parser functions</h3> </div> <p>Some parser functions represent a significant use of a wiki's resources and should be marked as "expensive". The number of expensive parser functions on any given page is limited by the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:$wgExpensiveParserFunctionLimit?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:$wgExpensiveParserFunctionLimit">$wgExpensiveParserFunctionLimit</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:$wgExpensiveParserFunctionLimit?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:$wgExpensiveParserFunctionLimit"> </a></span> setting. What counts as expensive is left up to the function itself, but typically, anything that is likely to cause a delay that extends beyond simple processing of data should be considered. This includes things like database reads and writes, launching a shell script synchronously, or file manipulation. On the other hand, not all such functions should necessarily be tagged. Semantic MediaWiki, for example, only marks a percentage of its database reads as expensive. This is due to the fact that on certain data-intensive pages, it could easily overflow the normal expensive parser function limits. In cases like this, the potential for noticeably slower performance that doesn't get flagged as expensive is a trade-off to having the functionality that SMW offers.</p> <p>To mark your parser function as expensive, from within the body of the function's code, use <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><span class="nv">$result</span> <span class="o">=</span> <span class="nv">$parser</span><span class="o">-></span><span class="na">incrementExpensiveFunctionCount</span><span class="p">();</span></code>. The return value will be <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code> if the expensive function limit has been reached or exceeded.</p> <div class="mw-heading mw-heading2"> <h2 id="Named_parameters">Named parameters</h2> </div> <p>Parser functions do not support named parameters the way templates and tag extensions do, but it is occasionally useful to fake it. Users are often accustomed to using vertical bars ( <code>|</code> ) to separate arguments, so it's nice to be able to do that in the parser function context, too. Here's a simple example of how to accomplish this:</p> <div style="overflow:auto;" class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="k">function</span> <span class="nf">ExampleExtensionRenderParserFunction</span><span class="p">(</span> <span class="o">&</span><span class="nv">$parser</span> <span class="p">)</span> <span class="p">{</span> <span class="c1">// Suppose the user invoked the parser function like so:</span> <span class="c1">// {{#myparserfunction: foo=bar | apple=orange | banana }}</span> <span class="nv">$options</span> <span class="o">=</span> <span class="nx">extractOptions</span><span class="p">(</span> <span class="nb">array_slice</span><span class="p">(</span> <span class="nb">func_get_args</span><span class="p">(),</span> <span class="mi">1</span> <span class="p">)</span> <span class="p">);</span> <span class="c1">// Now you've got an array that looks like this:</span> <span class="c1">// [foo] => 'bar'</span> <span class="c1">// [apple] => 'orange'</span> <span class="c1">// [banana] => true</span> <span class="c1">// Continue writing your code...</span> <span class="p">}</span> <span class="sd">/**</span> <span class="sd"> * Converts an array of values in form [0] => "name=value"</span> <span class="sd"> * into a real associative array in form [name] => value</span> <span class="sd"> * If no = is provided, true is assumed like this: [name] => true</span> <span class="sd"> *</span> <span class="sd"> * @param array string $options</span> <span class="sd"> * @return array $results</span> <span class="sd"> */</span> <span class="k">function</span> <span class="nf">extractOptions</span><span class="p">(</span> <span class="k">array</span> <span class="nv">$options</span> <span class="p">)</span> <span class="p">{</span> <span class="nv">$results</span> <span class="o">=</span> <span class="p">[];</span> <span class="k">foreach</span> <span class="p">(</span> <span class="nv">$options</span> <span class="k">as</span> <span class="nv">$option</span> <span class="p">)</span> <span class="p">{</span> <span class="nv">$pair</span> <span class="o">=</span> <span class="nb">array_map</span><span class="p">(</span> <span class="s1">'trim'</span><span class="p">,</span> <span class="nb">explode</span><span class="p">(</span> <span class="s1">'='</span><span class="p">,</span> <span class="nv">$option</span><span class="p">,</span> <span class="mi">2</span> <span class="p">)</span> <span class="p">);</span> <span class="k">if</span> <span class="p">(</span> <span class="nb">count</span><span class="p">(</span> <span class="nv">$pair</span> <span class="p">)</span> <span class="o">===</span> <span class="mi">2</span> <span class="p">)</span> <span class="p">{</span> <span class="nv">$results</span><span class="p">[</span> <span class="nv">$pair</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="p">]</span> <span class="o">=</span> <span class="nv">$pair</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span> <span class="nb">count</span><span class="p">(</span> <span class="nv">$pair</span> <span class="p">)</span> <span class="o">===</span> <span class="mi">1</span> <span class="p">)</span> <span class="p">{</span> <span class="nv">$results</span><span class="p">[</span> <span class="nv">$pair</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> <span class="k">return</span> <span class="nv">$results</span><span class="p">;</span> <span class="p">}</span> </pre> </div> <div class="mw-heading mw-heading2"> <h2 id="See_also">See also</h2> </div> <p>General and related guides:</p> <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Developing extensions">Manual:Developing extensions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Developing extensions"> </a></span>, or for more general information about extensions, see <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Extensions">Manual:Extensions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Extensions"> </a></span> and <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extensions_FAQ?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Extensions FAQ">Extensions FAQ</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extensions_FAQ?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Extensions FAQ"> </a></span>.</li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Tag_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Tag extensions">Manual:Tag extensions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Tag_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Tag extensions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Magic_words?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Magic words">Manual:Magic words</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Magic_words?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Magic words"> </a></span></li> </ul> <p>Code:</p> <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser.php">Manual:Parser.php</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser.php?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Parser.php"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks/ParserFirstCallInit?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Hooks/ParserFirstCallInit">Manual:Hooks/ParserFirstCallInit</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Hooks/ParserFirstCallInit?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Hooks/ParserFirstCallInit"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Parser_function_hooks?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Parser function hooks">Parser function hooks</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Parser_function_hooks?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Parser function hooks"> </a></span> - an (incomplete) list of parser functions provided by core and extensions</li> <li>The <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://github.com/JeroenDeDauw/ParserHooks%23parserhooks">Parser Hooks</a> PHP library, which provides an object orientated interface for declarative parser hooks</li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extension_data?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Manual:Extension data">Manual:Extension data</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Extension_data?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Manual:Extension data"> </a></span></li> </ul> <p>Examples:</p> <ul> <li>The <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension:ParserFunctions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Extension:ParserFunctions">ParserFunctions extension</a> is a well-known collection of parser functions.</li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Extension:ParserFunctions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/Help:Extension:ParserFunctions">Help:Extension:ParserFunctions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Help:Extension:ParserFunctions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Help:Extension:ParserFunctions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/:Category:Parser_function_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:MyLanguage/:Category:Parser function extensions">Category:Parser function extensions</a><span style="display:none">[[::Category:Parser function extensions| ]]</span></li> </ul><!-- NewPP limit report Parsed by mw‐api‐int.codfw.main‐648bd44df8‐zgwfn Cached time: 20241116065916 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.520 seconds Real time usage: 0.674 seconds Preprocessor visited node count: 3660/1000000 Post‐expand include size: 25344/2097152 bytes Template argument size: 14912/2097152 bytes Highest expansion depth: 18/100 Expensive parser function count: 67/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 36458/5000000 bytes Lua time usage: 0.063/10.000 seconds Lua memory usage: 1189100/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 326.740 1 -total 60.52% 197.734 29 Template:Ll 32.83% 107.272 1 Template:ExtensionTypes 30.57% 99.885 1 Template:Nmbox 25.59% 83.603 58 Template:Translatable 21.58% 70.503 30 Template:Pagelang 15.96% 52.142 1 Template:Flatlist 10.08% 32.923 11 Template:TNTN 9.24% 30.190 19 Template:Phpi 8.21% 26.815 19 Template:Inline-code --> <!-- Saved in parser cache with key mediawikiwiki:pcache:idhash:17997-0!canonical and timestamp 20241116065916 and revision id 6846788. Rendering was triggered because: api-parse --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --> <noscript> <img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"> </noscript> <div class="printfooter" data-nosnippet=""> Retrieved from "<a dir="ltr" href="https://www-mediawiki-org.translate.goog/w/index.php?title=Manual:Parser_functions&oldid=6846788&_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te">https://www.mediawiki.org/w/index.php?title=Manual:Parser_functions&oldid=6846788</a>" </div> </div> <div id="catlinks" class="catlinks" data-mw="interface"> <div id="mw-normal-catlinks" class="mw-normal-catlinks"> <a href="https://www-mediawiki-org.translate.goog/wiki/Special:Categories?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Special:Categories">Categories</a>: <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Category:MediaWiki_development?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Category:MediaWiki development">MediaWiki development</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Category:Parser_extensions?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Category:Parser extensions">Parser extensions</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Category:Wiki_markup?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Category:Wiki markup">Wiki markup</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Category:Customization_techniques?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Category:Customization techniques">Customization techniques</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Category:Sample_code?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" title="Category:Sample code">Sample code</a></li> </ul> </div> </div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer"> <ul id="footer-info"> <li id="footer-info-lastmod">This page was last edited on 9 November 2024, at 14:01.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. Text in <a class="external text" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Contents?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te">the Help: namespace</a> is available under the <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 License</a>. By using this site, you agree to the <a class="external text" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> and <a class="external text" href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy Policy</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="https://www-mediawiki-org.translate.goog/wiki/Project:About?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te">About mediawiki.org</a></li> <li id="footer-places-disclaimers"><a href="https://www-mediawiki-org.translate.goog/wiki/Project:General_disclaimer?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Code_of_Conduct?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://stats.wikimedia.org/%23/www.mediawiki.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://m.mediawiki.org/w/index.php?title%3DManual:Parser_functions%26mobileaction%3Dtoggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://translate.google.com/website?sl=auto&tl=te&hl=te&u=https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www-mediawiki-org.translate.goog/?_x_tr_sl=auto&_x_tr_tl=te&_x_tr_hl=te" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div> <script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-7d89b5d4c4-wz6zw","wgBackendResponseTime":134,"wgPageParseReport":{"limitreport":{"cputime":"0.520","walltime":"0.674","ppvisitednodes":{"value":3660,"limit":1000000},"postexpandincludesize":{"value":25344,"limit":2097152},"templateargumentsize":{"value":14912,"limit":2097152},"expansiondepth":{"value":18,"limit":100},"expensivefunctioncount":{"value":67,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":36458,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 326.740 1 -total"," 60.52% 197.734 29 Template:Ll"," 32.83% 107.272 1 Template:ExtensionTypes"," 30.57% 99.885 1 Template:Nmbox"," 25.59% 83.603 58 Template:Translatable"," 21.58% 70.503 30 Template:Pagelang"," 15.96% 52.142 1 Template:Flatlist"," 10.08% 32.923 11 Template:TNTN"," 9.24% 30.190 19 Template:Phpi"," 8.21% 26.815 19 Template:Inline-code"]},"scribunto":{"limitreport-timeusage":{"value":"0.063","limit":"10.000"},"limitreport-memusage":{"value":1189100,"limit":52428800}},"cachereport":{"origin":"mw-api-int.codfw.main-648bd44df8-zgwfn","timestamp":"20241116065916","ttl":2592000,"transientcontent":false}}});});</script> <script>function gtElInit() {var lib = new google.translate.TranslateService();lib.translatePage('en', 'te', function () {});}</script> <script src="https://translate.google.com/translate_a/element.js?cb=gtElInit&hl=te&client=wt" type="text/javascript"></script> </body> </html>