文件操作 - Rate.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/i2kairpad/public_html/wp-content/plugins/luckywp-table-of-contents/admin/Rate.php
编辑文件内容
<?php namespace luckywp\tableOfContents\admin; use luckywp\tableOfContents\core\base\BaseObject; use luckywp\tableOfContents\core\Core; class Rate extends BaseObject { const LINK = 'https://wordpress.org/support/plugin/luckywp-table-of-contents/reviews/?rate=5#new-post'; private $_isShow; /** * @return bool */ public function isShow() { if ($this->_isShow === null) { if (current_user_can('manage_options')) { $time = Core::$plugin->options->get('rate_time'); if ($time === false) { Core::$plugin->options->set('rate_time', time() + DAY_IN_SECONDS); $this->_isShow = false; } else { $this->_isShow = time() > $time; } } else { $this->_isShow = false; } } return $this->_isShow; } public function rate() { Core::$plugin->options->set('rate_time', time() + YEAR_IN_SECONDS * 5); } public function hide() { Core::$plugin->options->set('rate_time', time() + YEAR_IN_SECONDS * 5); } public function showLater() { Core::$plugin->options->set('rate_time', time() + WEEK_IN_SECONDS); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件