|
Server : LiteSpeed System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64 User : gazetufm ( 1431) PHP Version : 8.1.35 Disable Function : NONE Directory : /home2/gazetufm/leonora.al/wp-content/plugins/kirki/app/Http/Controllers/Api/ | |
|
Path: //home2/gazetufm/leonora.al/wp-content/plugins/kirki/app/Http/Controllers/Api/EditorController.php
Size: 1.38 KB
Permissions: 0644
<?php
namespace Kirki\App\Http\Controllers\Api;
use Exception;
use Kirki\App\Models\Page as PageModel;
use Kirki\App\Services\EditorService;
use Kirki\Framework\Http\Request;
use Kirki\Framework\Http\Response;
use function Kirki\Framework\response;
defined('ABSPATH') || exit;
class EditorController
{
/** @var EditorService */
protected $service;
public function __construct(EditorService $service)
{
$this->service = $service;
}
public function back_to_kirki_editor(Request $request)
{
$page = PageModel::exclude_trash()->find($request->int('postId'));
if (empty($page)) {
throw new Exception(esc_html__('Page not found.', 'kirki'), Response::NOT_FOUND);
}
$this->service->back_to_kirki_editor($page, $request->string('post_title'));
return response()->json([
'data' => [
'status' => true
],
]);
}
public function back_to_wordpress_editor(Request $request)
{
$page = PageModel::exclude_trash()->find($request->int('postId'));
if (empty($page)) {
throw new Exception(esc_html__('Page not found.', 'kirki'), Response::NOT_FOUND);
}
$this->service->back_to_wordpress_editor($page);
return response()->json([
'data' => [
'status' => true
],
]);
}
}