CINXE.COM

Manual:Developing extensions - 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/Special:MyLanguage/Manual:Developing_extensions"> <meta charset="UTF-8"> <title>Manual:Developing extensions - 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":"11e68daf-28c0-421a-929e-d9ac9a96c84b","wgCanonicalNamespace":"Manual","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":100,"wgPageName":"Manual:Developing_extensions","wgTitle":"Developing extensions","wgCurRevisionId":6690961,"wgRevisionId":6690961,"wgArticleId":54209,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Extension creation"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Manual:Developing_extensions","wgRelevantArticleId":54209,"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":30000,"wgInternalRedirectTargetUrl":"/wiki/Manual:Developing_extensions","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.cite.styles":"ready","ext.pygments":"ready", "ext.inputBox.styles":"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=["mediawiki.action.view.redirect","ext.cite.ux-enhancements","ext.pygments.view","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.translate.pagetranslation.uls","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&amp;modules=ext.cite.styles%7Cext.inputBox.styles%7Cext.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&amp;only=styles&amp;skin=vector-2022"> <script async src="/w/load.php?lang=en&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=site.styles&amp;only=styles&amp;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:Developing extensions - 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:Developing_extensions"> <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:Developing_extensions"> <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&amp;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/Special:MyLanguage/Manual:Developing_extensions"></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/Special:MyLanguage/Manual:Developing_extensions"></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_Developing_extensions rootpage-Manual_Developing_extensions 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" data-source-url="https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Developing_extensions" 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&amp;tl=te&amp;hl=te&amp;u=https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Developing_extensions&amp;anno=2" data-client="tr"></script><a class="mw-jump-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;u=https://www.wikidata.org/wiki/Special:NewItem?site%3Dmediawikiwiki%26page%3DManual%253ADeveloping%2Bextensions" 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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;returnto=Manual:Developing+extensions&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;returnto=Manual:Developing+extensions&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;returnto=Manual:Developing+extensions&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;returnto=Manual:Developing+extensions&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#" class="vector-toc-link"> <div class="vector-toc-text"> Beginning </div></a></li> <li id="toc-Setup" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Setup"> <div class="vector-toc-text"><span class="vector-toc-numb">1</span> <span>Setup</span> </div></a> <button aria-controls="toc-Setup-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 Setup subsection</span> </button> <ul id="toc-Setup-sublist" class="vector-toc-list"> <li id="toc-Registering_features_with_MediaWiki" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Registering_features_with_MediaWiki"> <div class="vector-toc-text"><span class="vector-toc-numb">1.1</span> <span>Registering features with MediaWiki</span> </div></a> <ul id="toc-Registering_features_with_MediaWiki-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Making_your_extension_user_configurable" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Making_your_extension_user_configurable"> <div class="vector-toc-text"><span class="vector-toc-numb">1.2</span> <span>Making your extension user configurable</span> </div></a> <ul id="toc-Making_your_extension_user_configurable-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Preparing_classes_for_autoloading" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Preparing_classes_for_autoloading"> <div class="vector-toc-text"><span class="vector-toc-numb">1.3</span> <span>Preparing classes for autoloading</span> </div></a> <ul id="toc-Preparing_classes_for_autoloading-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Defining_additional_hooks" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Defining_additional_hooks"> <div class="vector-toc-text"><span class="vector-toc-numb">1.4</span> <span>Defining additional hooks</span> </div></a> <ul id="toc-Defining_additional_hooks-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Adding_database_tables" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Adding_database_tables"> <div class="vector-toc-text"><span class="vector-toc-numb">1.5</span> <span>Adding database tables</span> </div></a> <ul id="toc-Adding_database_tables-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Set_up_localisation" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Set_up_localisation"> <div class="vector-toc-text"><span class="vector-toc-numb">1.6</span> <span>Set up localisation</span> </div></a> <ul id="toc-Set_up_localisation-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Add_logs" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Add_logs"> <div class="vector-toc-text"><span class="vector-toc-numb">1.7</span> <span>Add logs</span> </div></a> <ul id="toc-Add_logs-sublist" class="vector-toc-list"> </ul></li> </ul></li> <li id="toc-Handling_dependencies" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Handling_dependencies"> <div class="vector-toc-text"><span class="vector-toc-numb">2</span> <span>Handling dependencies</span> </div></a> <ul id="toc-Handling_dependencies-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Localisation" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Localisation"> <div class="vector-toc-text"><span class="vector-toc-numb">3</span> <span>Localisation</span> </div></a> <button aria-controls="toc-Localisation-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 Localisation subsection</span> </button> <ul id="toc-Localisation-sublist" class="vector-toc-list"> <li id="toc-Store_messages_in_<language-key>.json" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Store_messages_in_<language-key>.json"> <div class="vector-toc-text"><span class="vector-toc-numb">3.1</span> <span>Store messages in <i>&lt;language-key&gt;</i>.json</span> </div></a> <ul id="toc-Store_messages_in_<language-key>.json-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Store_message_documentation_in_qqq.json" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Store_message_documentation_in_qqq.json"> <div class="vector-toc-text"><span class="vector-toc-numb">3.2</span> <span>Store message documentation in <i>qqq</i>.json</span> </div></a> <ul id="toc-Store_message_documentation_in_qqq.json-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Load_the_localisation_file" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Load_the_localisation_file"> <div class="vector-toc-text"><span class="vector-toc-numb">3.3</span> <span>Load the localisation file</span> </div></a> <ul id="toc-Load_the_localisation_file-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Use_wfMessage_in_PHP" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Use_wfMessage_in_PHP"> <div class="vector-toc-text"><span class="vector-toc-numb">3.4</span> <span>Use wfMessage in PHP</span> </div></a> <ul id="toc-Use_wfMessage_in_PHP-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Use_mw.message_in_JavaScript" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Use_mw.message_in_JavaScript"> <div class="vector-toc-text"><span class="vector-toc-numb">3.5</span> <span>Use mw.message in JavaScript</span> </div></a> <ul id="toc-Use_mw.message_in_JavaScript-sublist" class="vector-toc-list"> </ul></li> </ul></li> <li id="toc-Extension_types" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Extension_types"> <div class="vector-toc-text"><span class="vector-toc-numb">4</span> <span>Extension types</span> </div></a> <ul id="toc-Extension_types-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Support_other_core_versions" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Support_other_core_versions"> <div class="vector-toc-text"><span class="vector-toc-numb">5</span> <span>Support other core versions</span> </div></a> <ul id="toc-Support_other_core_versions-sublist" class="vector-toc-list"> </ul></li> <li id="toc-License" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#License"> <div class="vector-toc-text"><span class="vector-toc-numb">6</span> <span>License</span> </div></a> <ul id="toc-License-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Publishing" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Publishing"> <div class="vector-toc-text"><span class="vector-toc-numb">7</span> <span>Publishing</span> </div></a> <button aria-controls="toc-Publishing-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 Publishing subsection</span> </button> <ul id="toc-Publishing-sublist" class="vector-toc-list"> <li id="toc-Deploying_and_registering" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Deploying_and_registering"> <div class="vector-toc-text"><span class="vector-toc-numb">7.1</span> <span>Deploying and registering</span> </div></a> <ul id="toc-Deploying_and_registering-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Help_documentation" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Help_documentation"> <div class="vector-toc-text"><span class="vector-toc-numb">7.2</span> <span>Help documentation</span> </div></a> <ul id="toc-Help_documentation-sublist" class="vector-toc-list"> </ul></li> <li id="toc-Releasing_updates" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Releasing_updates"> <div class="vector-toc-text"><span class="vector-toc-numb">7.3</span> <span>Releasing updates</span> </div></a> <ul id="toc-Releasing_updates-sublist" class="vector-toc-list"> </ul></li> </ul></li> <li id="toc-Providing_support_/_collaboration" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Providing_support_/_collaboration"> <div class="vector-toc-text"><span class="vector-toc-numb">8</span> <span>Providing support / collaboration</span> </div></a> <ul id="toc-Providing_support_/_collaboration-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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#See_also"> <div class="vector-toc-text"><span class="vector-toc-numb">9</span> <span>See also</span> </div></a> <button aria-controls="toc-See_also-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 See also subsection</span> </button> <ul id="toc-See_also-sublist" class="vector-toc-list"> <li id="toc-Learn_by_example" class="vector-toc-list-item vector-toc-level-2"><a class="vector-toc-link" href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Learn_by_example"> <div class="vector-toc-text"><span class="vector-toc-numb">9.1</span> <span>Learn by example</span> </div></a> <ul id="toc-Learn_by_example-sublist" class="vector-toc-list"> </ul></li> </ul></li> <li id="toc-References" 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/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#References"> <div class="vector-toc-text"><span class="vector-toc-numb">10</span> <span>References</span> </div></a> <ul id="toc-References-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">Developing extensions</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:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions&amp;action=edit&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions&amp;action=history&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions&amp;action=edit&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions&amp;action=history&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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:Developing_extensions&amp;oldid=6690961&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions&amp;action=info&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;page=Manual:Developing_extensions&amp;id=6690961&amp;wpFormIdentifier=titleform&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;url=https://www.mediawiki.org/wiki/Manual:Developing_extensions&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;url=https://www.mediawiki.org/wiki/Manual:Developing_extensions&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;bookcmd=book_creator&amp;referer=Manual:Developing+extensions&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;page=Manual:Developing_extensions&amp;action=show-download-screen&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions&amp;printable=yes&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;group=page-Manual:Developing+extensions&amp;action=page&amp;filter&amp;action_source=translate_page&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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:Developing_extensions/id?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manual:Mengembangkan ekstensi (3% translated)" lang="id" dir="ltr">Bahasa Indonesia</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/de?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--high" title="Manual: Entwickeln von Erweiterungen (96% 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:Developing_extensions/nl?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--complete" title="Handleiding: Extensies ontwikkelen (100% translated)" lang="nl" dir="ltr">Nederlands</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/vi?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--high" title="Thủ công:Dịch phần mở rộng (92% translated)" lang="vi" dir="ltr">Tiếng Việt</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/da?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Brugervejledning:Udvikling af udvidelser (7% translated)" lang="da" dir="ltr">dansk</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/es?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:Desarrollo de extensiones (37% translated)" lang="es" dir="ltr">español</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/fr?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--complete" title="Développement d'extensions (100% translated)" lang="fr" dir="ltr">français</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/it?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--high" title="Manuale:Sviluppo estensioni (87% translated)" lang="it" dir="ltr">italiano</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/hu?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Kézikönyv:Bővítmények fejlesztése (4% translated)" lang="hu" dir="ltr">magyar</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/pl?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Podręcznik:Tworzenie rozszerzeń (23% translated)" lang="pl" dir="ltr">polski</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/pt?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:Desenvolver Extensões (46% translated)" lang="pt" dir="ltr">português</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/pt-br?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--high" title="Manual:Desenvolvendo extensões (77% translated)" lang="pt-BR" dir="ltr">português do Brasil</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/fi?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manuaalinen:Laajennusten kehittäminen (4% translated)" lang="fi" dir="ltr">suomi</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/cs?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--high" title="Příručka:Vývoj rozšíření (96% translated)" lang="cs" dir="ltr">čeština</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/bg?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="Manual:Разработване на разширения (3% translated)" lang="bg" dir="ltr">български</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/ru?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Руководство:Разработка расширений (24% translated)" lang="ru" dir="ltr">русский</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/sd?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="مينيوئل:وڌاءَ (ايڪسٽينشن) ترقي ڏيڻ (12% translated)" lang="sd" dir="rtl">سنڌي</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/fa?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="دستی: در حال توسعه برنامه های افزودنی (6% translated)" lang="fa" dir="rtl">فارسی</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/hi?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--high" title="Manual:एक्सटेंशन विकसित करना (96% translated)" lang="hi" dir="ltr">हिन्दी</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/bn?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--low" title="ম্যানুয়াল:ডেভেলপিং এক্সটেনশন (9% translated)" lang="bn" dir="ltr">বাংলা</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/zh?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:开发扩展 (42% translated)" lang="zh" dir="ltr">中文</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/ja?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="Manual:拡張機能の開発 (51% translated)" lang="ja" dir="ltr">日本語</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Developing_extensions/ko?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-pt-progress mw-pt-progress--med" title="메뉴얼:확장기능 개발 (17% 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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Developing extensions">Development</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:Tag_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Tag extensions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser functions">Parser functions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Parser functions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Page content models"> </a></span></li> </ul> </div> </div> </div> <style data-mw-deduplicate="TemplateStyles:r6651108">.mw-parser-output table.ombox{margin:4px 10%;border-collapse:collapse;border:1px solid #a2a9b1;background-color:#f8f9fa;color:#333;box-sizing:border-box}.mw-parser-output .ombox td.mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ombox th.mbox-text,.mw-parser-output .ombox td.mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .ombox td.mbox-image{border:none;text-align:center;padding:2px 0 2px 0.9em}.mw-parser-output .ombox td.mbox-imageright{border:none;text-align:center;padding:2px 0.9em 2px 0}.mw-parser-output table.ombox-notice{border-color:#a2a9b1}.mw-parser-output table.ombox-speedy{background-color:#fee7e6;color:#333}.mw-parser-output table.ombox-speedy,.mw-parser-output table.ombox-delete{border-color:#b32424;border-width:2px}.mw-parser-output table.ombox-content{border-color:#f28500}.mw-parser-output table.ombox-style{border-color:#fc3}.mw-parser-output table.ombox-move{border-color:#9932cc}.mw-parser-output table.ombox-protection{border-color:#a2a9b1;border-width:2px}html body.mediawiki .mw-parser-output .ombox.mbox-small{clear:right;float:right;margin:4px 0 4px 1em;box-sizing:border-box;width:238px;font-size:88%;line-height:1.25em}@media screen{html.skin-theme-clientpref-night .mw-parser-output table.ombox{background-color:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output table.ombox{background-color:transparent;color:inherit}}</style> <table class="ombox ombox-notice plainlinks" role="presentation"> <tbody> <tr> <td class="mbox-image"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/40px-OOjs_UI_icon_information-progressive.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/60px-OOjs_UI_icon_information-progressive.svg.png 1.5x,https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/80px-OOjs_UI_icon_information-progressive.svg.png 2x" data-file-width="20" data-file-height="20"></span></span></td> <td class="mbox-text">If you intend to have your extension deployed on Wikimedia sites, read <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Writing_an_extension_for_deployment?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Writing an extension for deployment">Writing an extension for deployment</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Writing_an_extension_for_deployment?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Writing an extension for deployment"> </a></span></td> </tr> </tbody> </table> <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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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>Each <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Extensions">extension</a> consists of three parts:</p> <ol> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Setup">Setup</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Execution">Execution</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Localisation">Localisation</a></li> </ol> <p>A minimal extension will consist of the following structure:</p> <dl> <dt> <i>MyExtension</i>/extension.json </dt> <dd> Stores the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Setup">setup</a> instructions. The file name must be <i>extension.json</i>. (Prior to MediaWiki 1.25 the setup instructions were in a <code><i>MyExtension</i>/<i>MyExtension</i>.php</code> file named after the extension. Many extensions still have backwards-compatibility shims in this PHP file.) </dd> <dt> <i>MyExtension</i>/includes/ (or <i>MyExtension</i>/src/) </dt> <dd> Stores the PHP <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Execution">execution</a> code for the extension. </dd> <dt> <i>MyExtension</i>/resources/ (or <i>MyExtension</i>/modules/) </dt> <dd> Stores the client-side resources such as JavaScript, CSS and LESS for the extension. </dd> <dt> <i>MyExtension</i>/i18n/*.json </dt> <dd> Stores <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Localisation">localisation</a> information for the extension. </dd> </dl> <p>When you develop an extension, replace <i>MyExtension</i> above with the name of your extension. Use <i><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://en.wikipedia.org/wiki/Camel_case" class="extiw" title="w:Camel case">UpperCamelCase</a></i> names for its directory and PHP file(s); this is the general <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Coding_conventions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#File_naming" title="Special:MyLanguage/Manual:Coding conventions">file naming</a> convention.<sup id="cite_ref-1" class="reference"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> (The <span class="plainlinks"><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://gerrit.wikimedia.org/g/mediawiki/extensions/BoilerPlate" class="extiw" title="git:mediawiki/extensions/BoilerPlate">BoilerPlate extension</a></span> is a good starting point for your extension.)</p> <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"> While developing, you may want to disable caching by setting <code><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:$wgMainCacheType?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:$wgMainCacheType">$wgMainCacheType</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:$wgMainCacheType?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:$wgMainCacheType"> </a></span> = CACHE_NONE</code> and <code class="mw-highlight"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:$wgCacheDirectory?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:$wgCacheDirectory">$wgCacheDirectory</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:$wgCacheDirectory?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:$wgCacheDirectory"> </a></span> = <span class="k">false</span></code>, otherwise system messages and other changes may not show up. </div> <meta property="mw:PageProp/toc"> <div class="mw-heading mw-heading2"> <h2 id="Setup">Setup</h2> </div> <p>Your goal in writing the setup portion is to make installing the extension as easy as possible, so users only have to add this line to LocalSettings.php:</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="nx">wfLoadExtension</span><span class="p">(</span> <span class="s1">'MyExtension'</span> <span class="p">);</span> </pre> </div> <p>If you want to make your extension user configurable, you need to define and document some configuration parameters and your users' setup should look something like this:</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="nx">wfLoadExtension</span><span class="p">(</span> <span class="s1">'MyExtension'</span> <span class="p">);</span> <span class="nv">$wgMyExtensionConfigThis</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="nv">$wgMyExtensionConfigThat</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span> </pre> </div> <p>To reach this simplicity, your setup file needs to accomplish a number of tasks (described in detail in the following sections):</p> <ul> <li>register any media handlers, <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser functions">parser functions</a>, <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Special_pages?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Special pages">special pages</a>, <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Tag_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Tag extensions">custom XML tags</a>, and <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Variable?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Variable">variables</a> used by your extension.</li> <li>define and/or validate any configuration variables you have defined for your extension.</li> <li>prepare the classes used by your extension for autoloading</li> <li>determine what parts of your setup should be done immediately and what needs to be deferred until the MediaWiki core has been initialized and configured</li> <li>define any additional <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Hooks">hooks</a> needed by your extension</li> <li>create or check any new database tables required by your extension.</li> <li>set up localisation for your extension</li> </ul> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"> <div role="note" class="note note-info"> Good practice is to add a README file with basic info about how to install and configure the extension. You can use either plain text or <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://secure.phabricator.com/book/phabricator/article/remarkup/">Phabricator markup syntax</a>. For example, see the <a class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://phabricator.wikimedia.org/diffusion/EPFM">Phabricator Diffusion page</a> for the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension:Page_Forms?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Extension:Page Forms">Extension:Page Forms</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension:Page_Forms?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Extension:Page Forms"> </a></span>. If markdown is used, add the file extension <code>.md</code>. For example, see the <code>README.md</code> file for <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Parsoid?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Parsoid">Parsoid</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Parsoid?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Parsoid"> </a></span> on <a class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://phabricator.wikimedia.org/diffusion/GPAR">Phabricator Diffusion</a>. </div> <div class="mw-heading mw-heading3"> <h3 id="Registering_features_with_MediaWiki">Registering features with MediaWiki</h3> </div> <p>MediaWiki lists all the extensions that have been installed on its <code>Special:Version</code> page. For example, you can see all the extensions installed on this wiki at <a href="https://www-mediawiki-org.translate.goog/wiki/Special:Version?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:Version">Special:Version</a>.</p> <style data-mw-deduplicate="TemplateStyles:r4199130">.mw-parser-output .mw-version{border:1px solid #72777d;font-size:80%;line-height:1.2;border-collapse:collapse}.mw-parser-output .mw-version-ltr{float:right;margin:0 0 .5em .5em;text-align:right}.mw-parser-output .mw-version-rtl{float:left;margin:0 .5em .5em 0;text-align:left}.mw-parser-output .mw-version td{padding:.1em .3em}.mw-parser-output .mw-version-versionbox{border:5px solid #00af89;text-align:center}.mw-parser-output .mw-version-versionnumber{font-weight:bold;font-size:180%}.mw-parser-output .mw-version-version .mw-version-versionbox{border-color:#c8ccd1}.mw-parser-output .mw-version.mw-version-version2 .mw-version-versionbox{border-top-color:#c8ccd1;border-right-color:#c8ccd1;border-left-color:#c8ccd1}.mw-parser-output .mw-version-version-unsupported .mw-version-versionbox{border-color:#d33}.mw-parser-output .mw-version.mw-version-version2-unsupported .mw-version-versionbox{border-top-color:#d33;border-right-color:#d33;border-left-color:#d33}.mw-parser-output .mw-version-version-legacy .mw-version-versionbox{border-color:#f93}.mw-parser-output .mw-version.mw-version-version2-legacy .mw-version-versionbox{border-top-color:#f93;border-right-color:#f93;border-left-color:#f93}.mw-parser-output .mw-version-version-stable .mw-version-versionbox,.mw-parser-output .mw-version.mw-version.mw-version-and-later .mw-version-versionbox{border-color:#00af89}.mw-parser-output .mw-version.mw-version-version2-stable .mw-version-versionbox{border-top-color:#00af89;border-right-color:#00af89;border-left-color:#00af89}.mw-parser-output .mw-version-version-future .mw-version-versionbox{border-color:#8080c0}.mw-parser-output .mw-version.mw-version-version2-future .mw-version-versionbox{border-top-color:#8080c0;border-right-color:#8080c0;border-left-color:#8080c0}.mw-parser-output .mw-version-version-alpha .mw-version-versionbox{border-style:dotted}</style> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"> <tbody> <tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"> <div class="mw-version-versionnumber"> <small>≥</small> 1.25 </div></td> </tr> </tbody> </table> <p>To do this, add the extension details to <i><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/extension.json?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/extension.json">extension.json</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension.json?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-redirect" title="Extension.json"> </a></span></i>. The entry will look something like this:</p> <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">"Example"</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">"John Doe"</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:Example"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"This extension is an example and performs no discernible function"</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.5"</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">"validextensionclass"</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> <p><br> Many of the fields are optional, but it's still good practice to fill them out. The <code>manifest_version</code> refers to the version of the schema the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/extension.json?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/extension.json">extension.json</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension.json?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-redirect" title="Extension.json"> </a></span> file is written against. The available versions are 1 and 2. See <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extension.json/Schema?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#manifest_version" title="Special:MyLanguage/Manual:Extension.json/Schema">here for the documentation on this feature</a>. Unless you need to support an older version of MediaWiki, pick the latest version.</p> <p>In addition to the above registration, you must also "hook" your feature into MediaWiki. The above only sets up the Special:Version page. The way you do this depends on <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Extension_types">the type of your extension</a>. For details, please see the documentation for each type of extension: <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651103"></p> <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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Extensions"> </a></span></b> </div> <div class="nmbox-text mbox-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6387430"> <div class="hlist"> <ul> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Developing extensions">Development</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:Tag_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Tag extensions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser functions">Parser functions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Parser functions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Page content models"> </a></span></li> </ul> </div> </div> </div> <div class="mw-heading mw-heading3"> <h3 id="Making_your_extension_user_configurable">Making your extension user configurable</h3> </div> <p>If you want your user to be able to configure your extension, you'll need to provide one or more configuration variables. It is a good idea to give those variables a unique name. They should also follow MediaWiki <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Coding_conventions/PHP?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Naming" title="Special:MyLanguage/Manual:Coding conventions/PHP">naming conventions</a> (e.g. global variables should begin with $wg).</p> <p>For example, if your extension is named "MyExtension", you might want to name all your configuration variables to begin with <code>$wgMyExtension</code>. It is important that <b>none</b> of the MediaWiki core begins its variables this way and you have done a reasonable job of checking to see that none of the published extensions begin their variables this way. Users won't take kindly to having to choose between your extension and some other extensions because you chose overlapping variable names.</p> <p>It is also a good idea to include extensive documentation of any configuration variables in your installation notes.</p> <p>Here is an example boiler plate that can be used to get started:</p> <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">"BoilerPlate"</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">"0.0.0"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"Your Name"</span> <span class="w"> </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:BoilerPlate"</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">"boilerplate-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">"other"</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">"BoilerPlateHooks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"includes/BoilerPlateHooks.php"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"SpecialHelloWorld"</span><span class="p">:</span><span class="w"> </span><span class="s2">"includes/SpecialHelloWorld.php"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"config"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"BoilerPlateEnableFoo"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span> <span class="w"> </span><span class="nt">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Enables the foo functionality"</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"callback"</span><span class="p">:</span><span class="w"> </span><span class="s2">"BoilerPlateHooks::onExtensionLoad"</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">"BoilerPlateAlias"</span><span class="p">:</span><span class="w"> </span><span class="s2">"BoilerPlate.i18n.alias.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">"NameOfHook"</span><span class="p">:</span><span class="w"> </span><span class="s2">"BoilerPlateHooks::onNameOfHook"</span> <span class="w"> </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">"BoilerPlate"</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">"ResourceModules"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"ext.boilerPlate.foo"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"scripts"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"resources/ext.boilerPlate.js"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"resources/ext.boilerPlate.foo.js"</span> <span class="w"> </span><span class="p">],</span> <span class="w"> </span><span class="nt">"styles"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"resources/ext.boilerPlate.foo.css"</span> <span class="w"> </span><span class="p">]</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"ResourceFileModulePaths"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"localBasePath"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span> <span class="w"> </span><span class="nt">"remoteExtPath"</span><span class="p">:</span><span class="w"> </span><span class="s2">"BoilerPlate"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"SpecialPages"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"HelloWorld"</span><span class="p">:</span><span class="w"> </span><span class="s2">"SpecialHelloWorld"</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">2</span> <span class="p">}</span> </pre> </div> <p>Note that after calling <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nx">wfLoadExtension</span><span class="p">(</span> <span class="s1">'BoilerPlate'</span> <span class="p">);</span></code> the global variable <code>$wgBoilerPlateEnableFoo</code> does not exist. If you set the variable, e.g. in <code>LocalSettings.php</code> then the default value given in extension.json will not be used.</p> <p>For more details on how to use global variable inside custom extensions, please refer to <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Configuration_for_developers?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Configuration for developers">Manual:Configuration for developers</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Configuration_for_developers?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Configuration for developers"> </a></span>.</p> <div class="mw-heading mw-heading3"> <h3 id="Preparing_classes_for_autoloading">Preparing classes for autoloading</h3> </div> <p>If you choose to use classes to implement your extension, MediaWiki provides a simplified mechanism for helping PHP find the source file where your class is located. In most cases this should eliminate the need to write your own <code>__autoload($classname)</code> method.</p> <p>To use MediaWiki's autoloading mechanism, you add entries to the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:$wgAutoloadClasses?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:$wgAutoloadClasses">AutoloadClasses</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:$wgAutoloadClasses?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:$wgAutoloadClasses"> </a></span> field. The key of each entry is the class name; the value is the file that stores the definition of the class. For a simple one class extension, the class is usually given the same name as the extension, so your autoloading section might look like this (extension is named <i>MyExtension</i>):</p> <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">"AutoloadClasses"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MyExtension"</span><span class="p">:</span><span class="w"> </span><span class="s2">"includes/MyExtension.php"</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span> </pre> </div> <p>The filename is relative to the directory the extension.json file is in.</p> <p>For more complex extensions, <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://php.net/language.namespaces">namespaces</a> should be considered. See <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extension.json/Schema?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#AutoloadNamespaces" title="Special:MyLanguage/Manual:Extension.json/Schema">Manual:Extension.json/Schema#AutoloadNamespaces</a> for details.</p> <div class="mw-heading mw-heading3"> <h3 id="Defining_additional_hooks">Defining additional hooks</h3> </div> <p>See <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Hooks">Manual:Hooks</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Hooks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Hooks"> </a></span>.</p> <div class="mw-heading mw-heading3"> <h3 id="Adding_database_tables">Adding database tables</h3> </div> <p>Make sure the extension doesn't modify the core database tables. Instead, extension should create new tables with foreign keys to the relevant MW tables.</p> <table class="warning-message" style="background-color: var( --background-color-error-subtle, #ffe9e5 ); color: var( --color-base, #202122 ); border: 1px var( --border-color-error, #9f3526 ) solid; box-sizing: border-box; margin: 0.5em 0; padding: 0.5em;"> <tbody> <tr> <td style="white-space: nowrap; vertical-align: top;"><span style="position: relative; top: -2px;"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/18px-OOjs_UI_icon_notice-destructive.svg.png" decoding="async" width="18" height="18" class="mw-file-element" srcset="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/27px-OOjs_UI_icon_notice-destructive.svg.png 1.5x,https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/OOjs_UI_icon_notice-destructive.svg/36px-OOjs_UI_icon_notice-destructive.svg.png 2x" data-file-width="20" data-file-height="20"></span></span></span> <b>Warning:</b></td> <td style="padding-left: 0.5em vertical-align: top;">If your extension is used on any production WMF-hosted wiki please follow the <a class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://wikitech.wikimedia.org/wiki/Schema_changes">Schema change guide</a>.</td> </tr> </tbody> </table> <p>If your extension needs to add its own database tables, use the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks/LoadExtensionSchemaUpdates?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Hooks/LoadExtensionSchemaUpdates">LoadExtensionSchemaUpdates</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Hooks/LoadExtensionSchemaUpdates?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Hooks/LoadExtensionSchemaUpdates"> </a></span> hook. See the manual page for more information on usage.</p> <div class="mw-heading mw-heading3"> <h3 id="Set_up_localisation">Set up localisation</h3> </div> <p>See:</p> <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Localisation">Localisation (summary)</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Localisation?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Localisation">Localisation (detailed)</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Localisation?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Localisation"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Language?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Namespaces" title="Special:MyLanguage/Manual:Language">Namespaces</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Language?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Namespaces" title="Manual:Language"> </a></span></li> </ul> <div class="mw-heading mw-heading3"> <h3 id="Add_logs">Add logs</h3> </div> <p>On MediaWiki, all actions by users on wiki are tracked for transparency and collaboration. See <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Logging_to_Special:Log?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Logging to Special:Log">Manual:Logging to Special:Log</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Logging_to_Special:Log?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Logging to Special:Log"> </a></span> for how to do it.</p> <div class="mw-heading mw-heading2"> <h2 id="Handling_dependencies">Handling dependencies</h2> </div> <p>Assume that an extension requires the presence of another extension, for example because functionalities or database tables are to be used and error messages are to be avoided in case of non-existence.</p> <p>For example the extension <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension:CountingMarker?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Extension:CountingMarker">CountingMarker</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension:CountingMarker?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Extension:CountingMarker"> </a></span> requires the presence of the extension <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension:HitCounters?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Extension:HitCounters">HitCounters</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension:HitCounters?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Extension:HitCounters"> </a></span> for certain functions.</p> <p>One way to specify this would be by using the <code><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extension.json/Schema?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#requires" title="Special:MyLanguage/Manual:Extension.json/Schema">requires</a></code> key in <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extension.json?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Extension.json">extension.json</a>.</p> <p>Another option is using ExtensionRegistry (available since MW 1.25):</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span> <span class="k">if</span> <span class="p">(</span> <span class="nx">ExtensionRegistry</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">isLoaded</span><span class="p">(</span> <span class="s1">'HitCounters'</span><span class="p">,</span> <span class="s1">'&gt;=1.1'</span> <span class="p">)</span> <span class="p">{</span> <span class="cm">/* do some extra stuff, if extension HitCounters is present in version 1.1 and above */</span> <span class="p">}</span> </pre> </div> <p>Currently (as of February 2024, MediaWiki 1.41.0) the name of the extension-to-be-checked needs to exactly match the name in their extension.json.<sup id="cite_ref-2" class="reference"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-3" class="reference"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup></p> <p>Example: if you want to check the load status of extension "OpenIDConnect", you have to use it with a <i>space</i></p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span> <span class="k">if</span> <span class="p">(</span> <span class="nx">ExtensionRegistry</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">isLoaded</span><span class="p">(</span> <span class="s1">'OpenID Connect'</span> <span class="p">)</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre> </div> <div class="mw-heading mw-heading2"> <h2 id="Localisation">Localisation</h2> </div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651108"> <table class="ombox ombox-notice plainlinks" role="presentation"> <tbody> <tr> <td class="mbox-image"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/40px-OOjs_UI_icon_information-progressive.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/60px-OOjs_UI_icon_information-progressive.svg.png 1.5x,https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/80px-OOjs_UI_icon_information-progressive.svg.png 2x" data-file-width="20" data-file-height="20"></span></span></td> <td class="mbox-text"> <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Localisation?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Localisation">Localisation</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Localisation?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Localisation"> </a></span> – discusses the MediaWiki localisation engine, in particular, there is a list of features that can be localized and some review of the MediaWiki source code classes involved in localization.</li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:System_message?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Adding_new_messages" title="Special:MyLanguage/Help:System message">Creating new messages</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Help:System_message?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Adding_new_messages" title="Help:System message"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Localization_checks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Localization checks">Localization checks</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Localization_checks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Localization checks"> </a></span> – discusses common problems with localized messages</li> </ul></td> </tr> </tbody> </table> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"> <div role="note" class="note note-info"> While developing, you may want to disable both cache by setting <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$wgMainCacheType</span> <span class="o">=</span> <span class="nx">CACHE_NONE</span></code> and <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$wgCacheDirectory</span> <span class="o">=</span> <span class="k">false</span></code>, otherwise your system message changes may not show up. </div> <p>If you want your extension to be used on wikis that have a multi-lingual readership, you will need to add localisation support to your extension.</p> <div class="mw-heading mw-heading3"> <h3 id="Store_messages_in_<language-key>.json"><span id="Store_messages_in_.3Clanguage-key.3E.json"></span>Store messages in <i>&lt;language-key&gt;</i>.json</h3> </div> <p>Store message definitions in a localisation JSON file, one for each language key your extension is translated in. The messages are saved with a message key and the message itself using standard JSON format. Each message id should be lowercase and may <b>not</b> contain spaces. Each key should begin with the lowercased extension name. An example you can find in the <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/i18n/de.json">MobileFrontend extension</a>. Here is an example of a minimal JSON file (in this case <i>en.json</i>):</p> <p><i>en.json</i></p> <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">"myextension-desc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Adds the MyExtension great functionality."</span><span class="p">,</span> <span class="w"> </span><span class="nt">"myextension-action-message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"This is a test message"</span> <span class="p">}</span> </pre> </div> <div class="mw-heading mw-heading3"> <h3 id="Store_message_documentation_in_qqq.json">Store message documentation in <i>qqq</i>.json</h3> </div> <p>The documentation for message keys can be stored in the JSON file for the pseudo language with code <b>qqq</b>. A documentation of the example above can be:</p> <p><i>qqq.json</i>:</p> <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">"myextension-desc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"The description of MyExtension used in Extension credits."</span><span class="p">,</span> <span class="w"> </span><span class="nt">"myextension-action-message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Adds 'message' after 'action' triggered by user."</span> <span class="p">}</span> </pre> </div> <div class="mw-heading mw-heading3"> <h3 id="Load_the_localisation_file">Load the localisation file</h3> </div> <p>In your extension.json, define the location of your messages files (e.g. in directory <b>i18n/</b>):</p> <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">"MessagesDirs"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MyExtension"</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="p">}</span> </pre> </div> <div class="mw-heading mw-heading3"> <h3 id="Use_wfMessage_in_PHP">Use wfMessage in PHP</h3> </div> <p>In your setup and implementation code, replace each literal use of the message with a call to <code>wfMessage( $msgID, $param1, $param2, ... )</code>. In classes that implement <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:RequestContext?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#IContextSource" title="Special:MyLanguage/Manual:RequestContext">IContextSource</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:RequestContext?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#IContextSource" class="mw-redirect" title="Manual:RequestContext"> </a></span> (as well as some others such as subclasses of SpecialPage), you can use <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">msg</span><span class="p">(</span> <span class="nv">$msgID</span><span class="p">,</span> <span class="nv">$param1</span><span class="p">,</span> <span class="nv">$param2</span><span class="p">,</span> <span class="o">...</span> <span class="p">)</span></code> instead. Example:</p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"> <pre><span></span><span class="nx">wfMessage</span><span class="p">(</span> <span class="s1">'myextension-addition'</span><span class="p">,</span> <span class="s1">'1'</span><span class="p">,</span> <span class="s1">'2'</span><span class="p">,</span> <span class="s1">'3'</span> <span class="p">)</span><span class="o">-&gt;</span><span class="na">parse</span><span class="p">()</span> </pre> </div> <div class="mw-heading mw-heading3"> <h3 id="Use_mw.message_in_JavaScript">Use mw.message in JavaScript</h3> </div> <p>It's possible to use i18n functions in JavaScript too. Look at <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Messages_API?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Messages API">Manual:Messages API</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Messages_API?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Messages API"> </a></span> for details.</p> <p><span class="anchor" id="Execution"></span></p> <div class="mw-heading mw-heading2"> <h2 id="Extension_types">Extension types</h2> </div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651103"> <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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Extensions"> </a></span></b> </div> <div class="nmbox-text mbox-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6387430"> <div class="hlist"> <ul> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Developing extensions">Development</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:Tag_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Tag extensions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser functions">Parser functions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Parser functions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Page content models"> </a></span></li> </ul> </div> </div> </div> <p>Extensions can be categorized based on the programming techniques used to achieve their effect. Most complex extensions will use more than one of these techniques:</p> <ul> <li><b>Subclassing:</b> MediaWiki expects certain kinds of extensions to be implemented as subclasses of a MediaWiki-provided base class: <ul> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Special_pages?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Special pages"> </a></span></b> – Subclasses of the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:SpecialPage.php?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:SpecialPage.php">SpecialPage</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:SpecialPage.php?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:SpecialPage.php"> </a></span> class are used to build pages whose content is dynamically generated using a combination of the current system state, user input parameters, and database queries. Both reports and data entry forms can be generated. They are used for both reporting and administration purposes.</li> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Skins?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Skins"> </a></span></b> – Skins change the look and feel of MediaWiki by altering the code that outputs pages by subclassing the MediaWiki class <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:SkinTemplate.php?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:SkinTemplate.php">SkinTemplate</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:SkinTemplate.php?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:SkinTemplate.php"> </a></span>.</li> </ul></li> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Hooks?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Hooks"> </a></span></b> – A technique for injecting custom PHP code at key points within MediaWiki processing. They are widely used by MediaWiki's parser, its localization engine, its extension management system, and its page maintenance system. <ul> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Tag_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Tag extensions">Tag-function associations</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Tag_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Tag extensions"> </a></span></b> – <a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://en.wikipedia.org/wiki/XML" class="extiw" title="w:XML">XML</a> style tags that are associated with a php function that outputs HTML code. You do not need to limit yourself to formatting the text inside the tags. You don't even need to display it. Many tag extensions use the text as parameters that guide the generation of <a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://en.wikipedia.org/wiki/HTML" class="extiw" title="w:HTML">HTML</a> that embeds Google objects, data entry forms, RSS feeds, excerpts from selected wiki articles.</li> </ul></li> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Magic_words?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Magic words"> </a></span></b> – A technique for mapping a variety of wiki text string to a single id that is associated with a function. Both <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Variable?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Variable">variables</a> and <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser functions">parser functions</a> use this technique. All text mapped to that id will be replaced with the return value of the function. The mapping between the text strings and the id is stored in the array $magicWords. The interpretation of the id is a somewhat complex process – see <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Magic_words?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Magic words"> </a></span> for more information. <ul> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Variable?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Variable">Variable</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Variable?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Variable"> </a></span></b> – Variables are something of a misnomer. They are bits of wikitext that look like templates but have no parameters and have been assigned hard-coded values. Standard wiki markup such as <code><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Variables?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Help:Variables">{{PAGENAME}}</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Help:Variables?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-redirect" title="Help:Variables"> </a></span></code> or <code><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:Variables?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Help:Variables">{{SITENAME}}</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Help:Variables?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-redirect" title="Help:Variables"> </a></span></code> are examples of variables. They get their name from the source of their value: a php variable or something that could be assigned to a variable, e.g. a string, a number, an expression, or a function return value.</li> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Parser functions">Parser functions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Parser_functions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Parser functions"> </a></span></b> – <code>{{<i>functionname</i>: <i>argument 1</i> | <i>argument 2</i> | <i>argument 3</i>...}}</code>. Similar to tag extensions, parser functions process arguments and returns a value. Unlike tag extensions, the result of parser functions is <a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://en.wikipedia.org/wiki/wikitext" class="extiw" title="w:wikitext">wikitext</a>.</li> </ul></li> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/API:Extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/API:Extensions">API modules</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/API:Extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="API:Extensions"> </a></span></b> – You can add custom modules to MediaWiki's <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/API:Main_page?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/API:Main page">action API</a>, that can be invoked by JavaScript, bots or third-party clients.</li> <li><b><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Page_content_models?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Page content models">Page content models</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Page_content_models?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Page content models"> </a></span></b> – If you need to store data in formats other than wikitext, JSON, etc. then you can create a new <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:ContentHandler?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:ContentHandler">ContentHandler</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:ContentHandler?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:ContentHandler"> </a></span>.</li> </ul> <div class="mw-heading mw-heading2"> <h2 id="Support_other_core_versions">Support other core versions</h2> </div> <p>There are two widespread conventions for supporting older versions of MediaWiki core:</p> <ul> <li>Master: the master branch of the extension is compatible with as many old versions of core as possible. This results in a maintenance burden (backwards-compatibility hacks need to be kept around for a long time, and changes to the extension need to be tested with several versions of MediaWiki), but sites running old MediaWiki versions benefit from functionality recently added to the extension.</li> <li>Release branches: release branches of the extension are compatible with matching branches of core, e.g. sites using MediaWiki 1.42 need to use the REL1_42 branch of the extension. (For extensions hosted on <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/gerrit?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/gerrit">Gerrit</a>, these branches are automatically created when new versions of MediaWiki are released.) This results in cleaner code and faster development but users on old core versions do not benefit from bugfixes and new features unless they are <a href="https://www-mediawiki-org.translate.goog/wiki/Backporting_fixes?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Backporting fixes">backported</a> manually.</li> </ul> <p>Extension maintainers should declare with the <code><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Template:Extension?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#compatibility_policy" title="Special:MyLanguage/Template:Extension">compatibility policy</a></code> parameter of the {{<a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Template:Extension?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Template:Extension">Extension</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Template:Extension?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Template:Extension"> </a></span>}} template which convention they follow.</p> <p><span class="anchor" id="Licensing"></span></p> <div class="mw-heading mw-heading2"> <h2 id="License">License</h2> </div> <p><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Project:About?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Project:About">MediaWiki</a> is an open-source project and users are encouraged to make any <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/MediaWiki_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/MediaWiki extensions">MediaWiki extensions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/MediaWiki_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" class="mw-redirect" title="MediaWiki extensions"> </a></span> under an <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://opensource.org/licenses/category">Open Source Initiative (OSI) approved</a> license compatible with <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://opensource.org/licenses/GPL-2.0">GPL-2.0-or-later</a> (Wikimedia's standard software license).</p> <p>We recommend adopting one of the following compatible licenses for your projects in Gerrit:</p> <ul> <li><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://opensource.org/licenses/GPL-2.0">GNU General Public License, version 2 or later</a> (GPL-2.0-or-later)</li> <li><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://opensource.org/licenses/MIT">MIT License</a> (MIT)</li> <li><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://opensource.org/licenses/BSD-3-Clause">BSD License</a> (BSD-3-Clause)</li> <li><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://opensource.org/licenses/Apache-2.0">Apache License 2.0</a> (Apache-2.0)</li> </ul> <p>For extensions that have a compatible license, you can request developer access to the MediaWiki source repositories for extensions. To specify the licence in code and with "<code>license-name</code>" a key should be used to provide it's short name, e.g. "GPL-2.0-or-later" or "MIT" adhering to <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://spdx.org/licenses/">the list of identifiers at spdx.org</a>.</p> <p><br></p> <div class="mw-heading mw-heading2"> <h2 id="Publishing">Publishing</h2> </div> <p>To autocategorize and standardize the documentation of your existing extension, please see <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Template:Extension?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Template:Extension">Template:Extension</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Template:Extension?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Template:Extension"> </a></span>. To add your new extension to this Wiki:</p> <div style="background-color: #eeeeff; padding: 1em 0;"> <div class="mw-inputbox-centered" style=""> <form name="createbox" class="createbox mw-inputbox-form" action="/w/index.php" method="get"> <input type="hidden" value="edit" name="action"><input type="hidden" value="Template:Extension/Sample" name="preload"><input type="hidden" value="Extension:" name="prefix"> <div class="cdx-text-input"> <input name="title" class="mw-inputbox-input mw-inputbox-createbox cdx-text-input__input" placeholder="Enter your extension's name here" required size="40" dir="ltr"> </div><br><input type="submit" name="create" value="Create" class="cdx-button cdx-button--action-progressive cdx-button--weight-primary"> </form> </div> </div> <p>A developer sharing their code in the MediaWiki code repository should expect:</p> <dl> <dt> Feedback / Criticism / Code reviews </dt> <dd> Review and comments by other developers on things like <a class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://doc.wikimedia.org/">framework use</a>, security, efficiency and usability. </dd> </dl> <dl> <dt> Developer tweaking </dt> <dd> Other developers modifying your submission to improve or clean-up your code to meet new framework classes and methods, <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Coding_conventions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Coding conventions">coding conventions</a> and translations. </dd> </dl> <dl> <dt> Improved access for wiki sysadmins </dt> <dd> If you do decide to put your code on the wiki, another developer may decide to move it to the MediaWiki code repository for easier maintenance. You may then create a <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/developer_account?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/developer account">Developer account</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Developer_account?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Developer account"> </a></span> to continue maintaining it. </dd> </dl> <dl> <dt> Future versions by other developers </dt> <dd> New branches of your code being created automatically as new versions of MediaWiki are released. You should <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Backporting_fixes?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Backporting fixes">backport</a> to these branches if you want to support older versions. </dd> <dd> Incorporation of your code into other extensions with duplicate or similar purposes — incorporating the best features from each extension. </dd> </dl> <dl> <dt> Credit </dt> <dd> Credit for your work being preserved in future versions — including any merged extensions. </dd> <dd> Similarly, you should credit the developers of any extensions whose code you borrow from — especially when performing a merger. </dd> </dl> <p>Any developer who is uncomfortable with any of these actions occurring should not host in the code repository. You are still encouraged to create a summary page for your extension on the wiki to let people know about the extension, and where to download it.</p> <div class="mw-heading mw-heading3"> <h3 id="Deploying_and_registering">Deploying and registering</h3> </div> <p>If you intend to have your extension deployed on Wikimedia sites (including possibly Wikipedia), additional scrutiny is warranted in terms of performance and security. Consult <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Writing_an_extension_for_deployment?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Writing an extension for deployment">Writing an extension for deployment</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Writing_an_extension_for_deployment?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Writing an extension for deployment"> </a></span>.</p> <p>If your extension adds namespaces, you may wish to register its <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension_default_namespaces?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Extension default namespaces">default namespaces</a>; likewise, if it adds database tables or fields, you may want to register those at <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/database_field_prefixes?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/database field prefixes">Database field prefixes</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Database_field_prefixes?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Database field prefixes"> </a></span>.</p> <p>Please be aware that review and deployment of new extensions on Wikimedia sites can be extremely slow, and in some cases has taken more than two years.<sup id="cite_ref-4" class="reference"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></p> <div class="mw-heading mw-heading3"> <h3 id="Help_documentation">Help documentation</h3> </div> <p>You should provide <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Project:PD_help?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Project:PD help">public domain help documentation</a> for features provided by your extension. The convention is for extensions to have their user-focused help pages under a pseudo-namespace of <code>Help:Extension:&lt;ExtensionName&gt;</code>, with whatever subpages are required (the top level page will be automatically linked from the extension infobox if it exists). <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Help:CirrusSearch?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Help:CirrusSearch">Help:CirrusSearch</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Help:CirrusSearch?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Help:CirrusSearch"> </a></span> is a example of good documentation. You should give users a link to the documentation via the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Special_pages?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Help_page" title="Special:MyLanguage/Manual:Special pages">addHelpLink()</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Special_pages?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#Help_page" title="Manual:Special pages"> </a></span> function.</p> <div class="mw-heading mw-heading3"> <h3 id="Releasing_updates">Releasing updates</h3> </div> <p>There are a number of common approaches to releasing updates to extensions. These are generally defined according to the <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Compatibility?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#MediaWiki_extensions_and_skins" title="Special:MyLanguage/Compatibility">compatibility policy</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Compatibility?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#MediaWiki_extensions_and_skins" title="Compatibility"> </a></span> of the extension (<code>master</code>, <code>rel</code>, or <code>ltsrel</code>):</p> <ul> <li><code>master</code> - Releases may be tagged with version numbers on the master branch, and documentation provided on the extension's homepage describing which extension versions are compatible with which core versions. Release branches will still be created automatically, and you may wish to delete these if they are not intended to be used.</li> <li><code>rel</code> and <code>ltsrel</code> - Release by backporting changes to the <code>REL1_*</code> branches (either all changes, or only critical ones). Version numbers are generally not needed unless the extension is a dependency of another (the version number can then be provided in the other extension's configuration to ensure that incompatible combinations aren't installed). Many extensions will stay at the same version number for years.</li> </ul> <div class="mw-heading mw-heading2"> <h2 id="Providing_support_/_collaboration"><span id="Providing_support_.2F_collaboration"></span>Providing support / collaboration</h2> </div> <p>Extension developers should open an account on Wikimedia's <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Phabricator?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Phabricator">Phabricator</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Phabricator?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Phabricator"> </a></span>, and <a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Phabricator/Creating_and_renaming_projects?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Phabricator/Creating and renaming projects">request a new project for the extension</a>. This provides a public venue where users can submit issues and suggestions, and you can collaborate with users and other developers to triage bugs and plan features of your extension.</p> <div class="mw-heading mw-heading2"> <h2 id="See_also">See also</h2> </div> <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extension_registration?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Extension registration">Manual:Extension registration</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Extension_registration?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Extension registration"> </a></span> - provides further developer documentation on how to register extensions and skins.</li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/API:Extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/API:Extensions">API:Extensions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/API:Extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="API:Extensions"> </a></span> – explains how your extension can provide an API to clients</li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Extending_wiki_markup?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Extending wiki markup">Manual:Extending wiki markup</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Extending_wiki_markup?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Extending wiki markup"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Coding_conventions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Manual:Coding conventions">Manual:Coding conventions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Manual:Coding_conventions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Manual:Coding conventions"> </a></span></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Best_practices_for_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Best practices for extensions">Best practices for extensions</a></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/ResourceLoader?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/ResourceLoader">ResourceLoader</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/ResourceLoader?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="ResourceLoader"> </a></span></li> </ul> <div class="mw-heading mw-heading3"> <h3 id="Learn_by_example">Learn by example</h3> </div> <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension:Examples?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Extension:Examples">Extension:Examples</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension:Examples?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Extension:Examples"> </a></span> – implements some example features with extensive inline documentation <ul> <li><span class="plainlinks"><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://gerrit.wikimedia.org/g/mediawiki/extensions/examples" class="extiw" title="git:mediawiki/extensions/examples">examples git repo with this and other example code</a></span></li> </ul></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Extension:BoilerPlate?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/Extension:BoilerPlate">Extension:BoilerPlate</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/Extension:BoilerPlate?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Extension:BoilerPlate"> </a></span> – a functioning boilerplate extension, useful as a starting point for your own extension (<span class="plainlinks"><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://gerrit.wikimedia.org/g/mediawiki/extensions/BoilerPlate" class="extiw" title="git:mediawiki/extensions/BoilerPlate">git repo</a></span>) <ul> <li><i>Read</i> the Example extension, <i>base your own code on</i> the BoilerPlate extension.</li> </ul></li> <li><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://github.com/JonasGroeger/cookiecutter-mediawiki-extension">cookiecutter-mediawiki-extension</a> – a <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://cookiecutter.readthedocs.io/en/latest/">cookiecutter</a> template which generates a boilerplate extension (with variables etc.) <ul> <li>Allows you to get going quickly with your own extension.</li> <li>Can also generate the BoilerPlate extension.</li> </ul></li> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/List_of_simple_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:MyLanguage/List of simple extensions">List of simple extensions</a><span style="display:none"><a href="https://www-mediawiki-org.translate.goog/wiki/List_of_simple_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="List of simple extensions"> </a></span> - copy specific code from them</li> </ul> <div class="mw-heading mw-heading2"> <h2 id="References">References</h2> </div> <div class="mw-references-wrap"> <ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_ref-1">↑</a></span> <span class="reference-text"><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://lists.wikimedia.org/pipermail/wikitech-l/2011-August/054839.html" class="extiw" title="mailarchive:wikitech-l/2011-August/054839.html">mailarchive:wikitech-l/2011-August/054839.html</a></span></li> <li id="cite_note-2"><span class="mw-cite-backlink"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_ref-2">↑</a></span> <span class="reference-text"><a class="external free" href="https://www-mediawiki-org.translate.goog/wiki/Topic:Xyjw7nhfzaas5r5z?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te">https://www.mediawiki.org/wiki/Topic:Xyjw7nhfzaas5r5z</a></span></li> <li id="cite_note-3"><span class="mw-cite-backlink"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_ref-3">↑</a></span> <span class="reference-text"><a class="external free" href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://phabricator.wikimedia.org/T356596">https://phabricator.wikimedia.org/T356596</a></span></li> <li id="cite_note-4"><span class="mw-cite-backlink"><a href="https://www-mediawiki-org.translate.goog/wiki/Special:MyLanguage/Manual:Developing_extensions?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te#cite_ref-4">↑</a></span> <span class="reference-text"><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://phabricator.wikimedia.org/T148848" class="extiw" title="phabricator:T148848">phabricator:T148848</a></span></li> </ol> </div><!-- NewPP limit report Parsed by mw‐web.eqiad.main‐5dc468848‐pl7ck Cached time: 20241124062538 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.680 seconds Real time usage: 1.589 seconds Preprocessor visited node count: 5656/1000000 Post‐expand include size: 56220/2097152 bytes Template argument size: 23850/2097152 bytes Highest expansion depth: 18/100 Expensive parser function count: 83/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 41918/5000000 bytes Lua time usage: 0.132/10.000 seconds Lua memory usage: 1972777/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 1180.189 1 -total 26.71% 315.213 64 Template:Ll 11.04% 130.295 128 Template:Translatable 9.82% 115.844 66 Template:Pagelang 8.74% 103.122 3 Template:ExtensionTypes 8.09% 95.455 1 Template:Nmbox 7.65% 90.306 4 Template:Phpi 7.46% 88.015 4 Template:Inline-code 4.49% 52.934 2 Template:Mbox 4.37% 51.537 1 Template:Flatlist --> <!-- Saved in parser cache with key mediawikiwiki:pcache:idhash:54209-0!canonical and timestamp 20241124062538 and revision id 6690961. Rendering was triggered because: page-view --> </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:Developing_extensions&amp;oldid=6690961&amp;_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te">https://www.mediawiki.org/w/index.php?title=Manual:Developing_extensions&amp;oldid=6690961</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&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Special:Categories">Category</a>: <ul> <li><a href="https://www-mediawiki-org.translate.goog/wiki/Category:Extension_creation?_x_tr_sl=auto&amp;_x_tr_tl=te&amp;_x_tr_hl=te" title="Category:Extension creation">Extension creation</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 8 August 2024, at 22:53.</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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_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&amp;_x_tr_tl=te&amp;_x_tr_hl=te">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;u=https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://translate.google.com/website?sl=auto&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;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&amp;tl=te&amp;hl=te&amp;u=https://m.mediawiki.org/w/index.php?title%3DManual:Developing_extensions%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&amp;tl=te&amp;hl=te&amp;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&amp;_x_tr_tl=te&amp;_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-f69cdc8f6-9s56p","wgBackendResponseTime":137,"wgPageParseReport":{"limitreport":{"cputime":"0.680","walltime":"1.589","ppvisitednodes":{"value":5656,"limit":1000000},"postexpandincludesize":{"value":56220,"limit":2097152},"templateargumentsize":{"value":23850,"limit":2097152},"expansiondepth":{"value":18,"limit":100},"expensivefunctioncount":{"value":83,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":41918,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 1180.189 1 -total"," 26.71% 315.213 64 Template:Ll"," 11.04% 130.295 128 Template:Translatable"," 9.82% 115.844 66 Template:Pagelang"," 8.74% 103.122 3 Template:ExtensionTypes"," 8.09% 95.455 1 Template:Nmbox"," 7.65% 90.306 4 Template:Phpi"," 7.46% 88.015 4 Template:Inline-code"," 4.49% 52.934 2 Template:Mbox"," 4.37% 51.537 1 Template:Flatlist"]},"scribunto":{"limitreport-timeusage":{"value":"0.132","limit":"10.000"},"limitreport-memusage":{"value":1972777,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-5dc468848-pl7ck","timestamp":"20241124062538","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&amp;hl=te&amp;client=wt" type="text/javascript"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10