MediaWiki  master
docs/magicword.txt File Reference

Variables

magicword txt Magic Words are some phrases used in the wikitext They are used for two that looks like templates but that don t accept any parameter *Parser functions(like {{fullurl:...}}, {{#special:...}}) $magicWords ['en']
 
function wfGetCustomMagicWordValue $parser
 
 $wgExtensionMessagesFiles ['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php'
 
 $wgHooks ['MagicWordwgVariableIDs'][] = 'wfAddCustomMagicWordID'
 
Note __pad1__
 
And to add a new parser function
 
magicword txt Magic Words are some phrases used in the wikitext They are used for two things
 
return true
 

Variable Documentation

◆ $magicWords

function wfAddCustomMagicWordID $magicWords
Initial value:
'mag_custom' => array( 1, 'CUSTOM' ),
)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))

Definition at line 33 of file magicword.txt.

Referenced by CoreParserFunctions::defaultsort(), CoreParserFunctions::displaytitle(), Languages::getCaseMismatchMagicWords(), Languages::getObsoleteMagicWords(), Languages::getOverridingMagicWords(), ResourceLoaderJqueryMsgModule::getScript(), Languages::getUntranslatedMagicWords(), Languages::loadFile(), InfoAction::pageInfo(), CoreParserFunctions::pagesincategory(), and CoreParserFunctions::urlencode().

◆ $parser

function wfGetCustomMagicWordValue $parser
Initial value:
{
if( $index == 'mag_custom' ){
$ret = $varCache['mag_custom'] = "Custom value";
}
return true
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition: hooks.txt:1997

Definition at line 52 of file magicword.txt.

◆ $wgExtensionMessagesFiles

$wgExtensionMessagesFiles[ 'ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php'

◆ $wgHooks

$wgHooks[ 'ParserFirstCallInit'][] = 'wfAddCustomMagicWordID'

Definition at line 44 of file magicword.txt.

◆ __pad1__

Note __pad1__

Definition at line 90 of file magicword.txt.

◆ function

And to add a new parser function

Definition at line 65 of file magicword.txt.

◆ things

magicword txt Magic Words are some phrases used in the wikitext They are used for two things

◆ true

return true

Definition at line 49 of file magicword.txt.