Website : phonehp.ir
backdoor
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Home
Console
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
nehpir
/
www
/
wp-content
/
plugins
/
woocommersa
/
includes
/
API
/
Filename :
SmartFilterController.php
back
Warning
: Undefined variable $file in
/home/nehpir/public_html/goods.php
on line
545
Copy
<?php namespace WooCommersa\API; if (!defined('ABSPATH')) exit; class SmartFilterController extends BaseController { public function __construct() { add_action('rest_api_init', [$this, 'register_routes']); } public function register_routes() { register_rest_route($this->namespace, '/smart-filters', [ 'methods' => ['GET', 'POST'], 'callback' => [$this, 'handle_filters'], 'permission_callback' => [$this, 'permissions_check'], ]); register_rest_route($this->namespace, '/smart-filters/(?P<id>[a-zA-Z0-9_\-]+)', [ 'methods' => 'DELETE', 'callback' => [$this, 'delete_filter'], 'permission_callback' => [$this, 'permissions_check'], ]); } public function handle_filters($request) { $filters = get_option('wm_smart_filters', []); if ($request->get_method() === 'POST') { $new_filter = $request->get_json_params(); if (empty($new_filter['id'])) { $new_filter['id'] = 'filter_' . time(); } $filters[$new_filter['id']] = $new_filter; update_option('wm_smart_filters', $filters); return new \WP_REST_Response(['success' => true, 'id' => $new_filter['id']], 200); } return new \WP_REST_Response(array_values($filters), 200); } public function delete_filter($request) { $id = $request['id']; $filters = get_option('wm_smart_filters', []); if (isset($filters[$id])) { unset($filters[$id]); update_option('wm_smart_filters', $filters); } return new \WP_REST_Response(['success' => true], 200); } }