文件操作 - Ajax.php
返回文件管理
返回主菜单
删除本文件
文件: /root/Desktop/OLD/plugin-wordpress/advanced-cron-manager/vendor/underdev/utils/src/Ajax.php
编辑文件内容
<?php /** * Ajax class * Handles AJAX calls */ namespace underDEV\Utils; class Ajax { /** * Verifies nonce string * @param string $action action name, as defined while creating nonce hash, required * @param string $nonce $_REQUEST array key where to search for nonce, default 'nonce' * @return void dies when nonce is wrong */ public function verify_nonce( $action = null, $nonce = 'nonce' ) { if ( $action === null ) { trigger_error( 'Action cannot be empty' ); } if ( check_ajax_referer( $action, $nonce, false ) == false ) { $this->error( array( 'wrong_nonce' ) ); } } /** * Prints success for JS * @param mixed $data anything * @return void */ public function success( $data ) { wp_send_json_success( $data ); } /** * Prints error for JS * @param mixed $data anything * @return void */ public function error( $data ) { wp_send_json_error( $data ); } /** * Responds to JS with message * @param mixed $success if empty, nothing will be passed * @param array $errors if not empty, an error will be returned * @return void */ public function response( $success = null, $errors = array() ) { if ( ! empty( $errors ) ) { $this->error( $errors ); } $this->success( $success ); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件