文件操作 - SiteProfileController.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/extendify/app/Shared/Controllers/SiteProfileController.php
编辑文件内容
<?php /** * Controls Site Profile options */ namespace Extendify\Shared\Controllers; defined('ABSPATH') || die('No direct access.'); use Extendify\Shared\Services\Sanitizer; /** * The controller for persisting site data */ class SiteProfileController { /** * Persist single data * * @param \WP_REST_Request $request - The request. * @return \WP_REST_Response */ public static function store($request) { $value = $request->get_param('siteProfile'); \update_option('extendify_site_profile', Sanitizer::sanitizeUnknown($value)); $siteProfile = is_string($value) ? json_decode($value, true) : $value; return new \WP_REST_Response($siteProfile); } /** * Get option data by name. * * @return \WP_REST_Response */ public static function get() { $siteProfile = \get_option('extendify_site_profile', []); return new \WP_REST_Response($siteProfile); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件