403Webshell
Server IP : 108.167.142.43  /  Your IP : 216.73.217.58
Web Server : Apache
System : Linux gator4174.hostgator.com 5.14.0-687.39.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Aug 18 06:09:16 EDT 2026 x86_64
User : delarice ( 2406)
PHP Version : 8.3.36
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home2/delarice/www/wp-content/plugins/templately/modules/my-cloud/REST/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/delarice/www/wp-content/plugins/templately/modules/my-cloud/REST/SavedTemplates.php
<?php

namespace Templately\Modules\MyCloud\REST;

use Templately\API\API;
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;

/**
 * As SavedTemplates is enabled in Elementor.
 * So, this class will represent Elementor's Templates Feature.
 *
 * @method \Templately\Modules\ElementorIntegration\Platform\Elementor platform( $id )
 *
 * @since 2.0.0
 *
 * @link https://templately.com
 */
class SavedTemplates extends API {
	private $endpoint = 'saved-templates';

	public function permission_check( WP_REST_Request $request ) {
		$this->request = $request;
		$_route        = $request->get_route();
		$_id           = (int) $this->get_param( 'id', 0 );

		if( $_route === "/templately/v1/saved-templates/delete" && ! (current_user_can( 'delete_post', $_id ) && get_post_type($_id) === "elementor_library")) {
			return $this->error('invalid_permission', __( 'Sorry, you do not have permission to delete this template.', 'templately' ), 'saved-templates/delete', 403 );
		}
		return true;
	}

	public function register_routes() {
		$this->get( $this->endpoint, [ $this, 'get_saved_templates' ] );
		$this->post($this->endpoint . '/delete', [ $this, 'delete' ] );
	}

	/**
	 * Get all the saved templates from Elementor library.
	 *
	 * @param WP_REST_Request $request
	 *
	 * @return array
	 */
	public function get_saved_templates( WP_REST_Request $request) {
		$platform = $this->get_param( 'platform', 'elementor' );
		return $this->platform( $platform )->get_saved_templates( $request->get_params() );
	}

	/**
	 * Delete saved template.
	 *
	 * @param WP_REST_Request $request
	 *
	 * @return WP_Error|WP_REST_Response
	 */
	public function delete( WP_REST_Request $request ){
		$platform = $this->get_param( 'platform', 'elementor' );
		return $this->platform( $platform )->delete( $request->get_params() );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit