uawdijnntqw1x1x1
IP : 216.73.216.172
Hostname : webm041.cluster026.gra.hosting.ovh.net
Kernel : Linux webm041.cluster026.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
OS : Linux
PATH:
/
home
/
.
/
monikamovk
/
.
/
www
/
.
/
wp-content
/
plugins
/
nextgen-gallery
/
src
/
DataTypes
/
..
/
REST
/
Admin
/
Block.php
/
/
<?php namespace Imagely\NGG\REST\Admin; use Imagely\NGG\DataMappers\Image as ImageMapper; use Imagely\NGG\DataStorage\Manager as StorageManager; class Block extends \WP_REST_Controller { public function __construct() { $this->namespace = 'ngg/v1'; $this->rest_base = 'admin/block/image'; } public function register_routes() { \register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<image_id>.*)/', [ 'args' => [ 'image_id' => [ 'description' => \__( 'Image ID', 'nggallery' ), 'type' => 'integer', 'required' => true, ], ], [ 'methods' => \WP_REST_Server::READABLE, 'callback' => [ $this, 'get_item' ], 'permission_callback' => '__return_true', ], ] ); } /** * @param \WP_REST_Request $request * @return \WP_Error|\WP_REST_Response */ public function get_item( $request ) { $id = $request->get_param( 'image_id' ); $image = ImageMapper::get_instance()->find( $id ); if ( ! $image ) { return new \WP_Error( 'invalid_image_id', 'Invalid image ID', [ 'status' => 404 ] ); } $storage = StorageManager::get_instance(); $image->thumbnail_url = $storage->get_image_url( $image, 'thumb' ); $image->image_url = $storage->get_image_url( $image, 'full' ); return new \WP_REST_Response( [ 'success' => true, 'image' => $image, ] ); } }
/home/./monikamovk/./www/./wp-content/plugins/nextgen-gallery/src/DataTypes/../REST/Admin/Block.php