Index: trunk/phase3/includes/parser/CoreParserFunctions.php |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | $parser->setFunctionHook( 'talkpagenamee', array( __CLASS__, 'talkpagenamee' ), SFH_NO_HASH ); |
69 | 69 | $parser->setFunctionHook( 'subjectpagename', array( __CLASS__, 'subjectpagename' ), SFH_NO_HASH ); |
70 | 70 | $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH ); |
| 71 | + $parser->setFunctionHook( 'pipetrick', array( __CLASS__, 'pipetrick' ), SFH_NO_HASH ); |
71 | 72 | $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS ); |
72 | 73 | $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) ); |
73 | 74 | |
— | — | @@ -440,6 +441,17 @@ |
441 | 442 | } |
442 | 443 | |
443 | 444 | /** |
| 445 | + * Performs the pipe trick. Can be used in three ways: |
| 446 | + * {{pipetrick:title}} == {{pipetrick:title|}} != {{pipetrick:|title}} |
| 447 | + */ |
| 448 | + static function pipetrick( $parser, $link = '', $text = '' ) { |
| 449 | + if ($link) |
| 450 | + return $parser->getPipeTrickText( $link ); |
| 451 | + else |
| 452 | + return $parser->getPipeTrickLink( $text ); |
| 453 | + } |
| 454 | + |
| 455 | + /** |
444 | 456 | * Return the number of pages in the given category, or 0 if it's nonexis- |
445 | 457 | * tent. This is an expensive parser function and can't be called too many |
446 | 458 | * times per page. |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -317,6 +317,7 @@ |
318 | 318 | 'plural' => array( 0, 'PLURAL:' ), |
319 | 319 | 'fullurl' => array( 0, 'FULLURL:' ), |
320 | 320 | 'fullurle' => array( 0, 'FULLURLE:' ), |
| 321 | + 'pipetrick' => array( 0, 'PIPETRICK:' ), |
321 | 322 | 'lcfirst' => array( 0, 'LCFIRST:' ), |
322 | 323 | 'ucfirst' => array( 0, 'UCFIRST:' ), |
323 | 324 | 'lc' => array( 0, 'LC:' ), |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -834,6 +834,7 @@ |
835 | 835 | * (bug 4099) Pipe trick doesn't work when emptiness is only provided by empty template parameter |
836 | 836 | * (bug 845) [[#foo|]], [[/bar|]] should be equivalent to [[#foo|foo]], [[/bar|bar]] (new use of "pipe trick") |
837 | 837 | * (bug 21660) Support full-width commas for pipe trick |
| 838 | +* (bug 7264) Magic word to give Page Title as if pipe-trick performed on it {{pipetrick:}} |
838 | 839 | |
839 | 840 | === Languages updated in 1.16 === |
840 | 841 | |