empt all content namespaces.)
* $wgForwardSearchUrl has been removed entirely. Documented setting since 1.4
has been $wgSearchForwardUrl.
+* $wgApiScript can now be defined if your API isn't named api.php or it's not
+ in the usual location. Setting to false defaults to "$wgScriptPath/api
+ $wgScriptExtension".
=== New features in 1.14 ===
'EditSectionLinkForOther' hook has been removed, but 'EditSectionLink' is
run in all cases instead, so extensions using the old hooks should still work
if they ran roughly the same code for both hooks (as is almost certain).
+* New parser function {{apiurl:}} links to the local API. {{apiurl:help}} would
+ link to action=help. Other params are passed as well.
=== Bug fixes in 1.14 ===
$parser->setFunctionHook( 'localurle', array( __CLASS__, 'localurle' ), SFH_NO_HASH );
$parser->setFunctionHook( 'fullurl', array( __CLASS__, 'fullurl' ), SFH_NO_HASH );
$parser->setFunctionHook( 'fullurle', array( __CLASS__, 'fullurle' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'apiurl', array( __CLASS__, 'apiurl' ), SFH_NO_HASH );
$parser->setFunctionHook( 'formatnum', array( __CLASS__, 'formatnum' ), SFH_NO_HASH );
$parser->setFunctionHook( 'grammar', array( __CLASS__, 'grammar' ), SFH_NO_HASH );
$parser->setFunctionHook( 'plural', array( __CLASS__, 'plural' ), SFH_NO_HASH );
static function localurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeLocalURL', $s, $arg ); }
static function fullurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getFullURL', $s, $arg ); }
static function fullurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeFullURL', $s, $arg ); }
+ static function apiurl( $parser, $s = '', $arg = null ) {
+ global $wgEnableApi;
+ # Don't bother linking to the API if they can't use it.
+ if ( $wgEnableApi === false ) {
+ return array( 'found' => false );
+ }
+ global $wgServer, $wgApiScript;
+ $path = $wgServer . $wgApiScript . '?action=' . $s;
+ if ( !is_null($arg ) ) {
+ $path .= '&' . $arg;
+ }
+ return $path;
+ }
static function urlFunction( $func, $s = '', $arg = null ) {
$title = Title::newFromText( $s );
'plural' => array( 0, 'PLURAL:' ),
'fullurl' => array( 0, 'FULLURL:' ),
'fullurle' => array( 0, 'FULLURLE:' ),
+ 'apiurl' => array( 0, 'APIURL:' ),
'lcfirst' => array( 0, 'LCFIRST:' ),
'ucfirst' => array( 0, 'UCFIRST:' ),
'lc' => array( 0, 'LC:' ),