403Webshell
Server IP : 157.230.181.24  /  Your IP : 216.73.217.11
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux conductive 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64
User :  ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/vhosts/untold/app/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vhosts/untold/app/admin/rest.php
<?php

	/**
	 * Plugin Name: WP REST API filter parameter
	 * Description: This plugin adds a "filter" query parameter to API post collections to filter returned results based on public WP_Query parameters, adding back the "filter" parameter that was removed from the API when it was merged into WordPress core.
	 * Author: WP REST API Team
	 * Author URI: http://v2.wp-api.org
	 * Version: 0.1
	 * License: GPL2+
	 **/
	add_action('rest_api_init', function () {
		foreach(get_post_types(['show_in_rest' => TRUE], 'objects') as $post_type) {
			add_filter('rest_' . $post_type->name . '_query', 'rest_api_filter_add_filter_param', 10, 2);
		}
	});

	/**
	 * Add the filter parameter
	 *
	 * @param  array           $args    The query arguments.
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return array $args.
	 **/
	function rest_api_filter_add_filter_param($args, $request) {
		// Bail out if no filter parameter is set.
		if(empty($request['filter']) || !is_array($request['filter'])) {
			return $args;
		}
		$filter = $request['filter'];
		if(isset($filter['posts_per_page']) && ((int)$filter['posts_per_page'] >= 1 && (int)$filter['posts_per_page'] <= 100)) {
			$args['posts_per_page'] = $filter['posts_per_page'];
		}
		global $wp;
		$vars = apply_filters('query_vars', $wp->public_query_vars);
		foreach($vars as $var) {
			if(isset($filter[$var])) {
				$args[$var] = $filter[$var];
			}
		}

		return $args;
	}

Youez - 2016 - github.com/yon3zu
LinuXploit