本文整理汇总了PHP中MS_Factory::delete_transient方法的典型用法代码示例。如果您正苦于以下问题:PHP MS_Factory::delete_transient方法的具体用法?PHP MS_Factory::delete_transient怎么用?PHP MS_Factory::delete_transient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MS_Factory
的用法示例。
在下文中一共展示了MS_Factory::delete_transient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Delete transient.
*
* @since 1.0.0
*/
public function delete()
{
do_action('ms_model_transient_delete_before', $this);
$option_key = $this->option_key();
MS_Factory::delete_transient($option_key);
wp_cache_delete($option_key, 'MS_Model_Transient');
do_action('ms_model_transient_delete_after', $this);
}
示例2: remove_application
/**
* Remove user application for this coupon.
*
* @since 1.0.0
*
* @param int $user_id The user id.
* @param int $membership_id The membership id.
*/
public static function remove_application($user_id, $membership_id)
{
$key = self::get_transient_name($user->id, $membership->id);
MS_Factory::delete_transient($key);
do_action('ms_addon_coupon_model_remove_application', $user_id, $membership_id);
}
示例3: verify_token
/**
* Verfies the admin token in the $_GET collection
*
* $_GET['ms_token'] must match the current ms_token
* $_POST['confirm'] must have value 'yes'
*
* @since 1.0.0
* @internal
*
* @param string $action Like a nonce, this is the action to execute.
* @return bool
*/
private static function verify_token($action)
{
if (!self::valid_user()) {
return false;
}
if (empty($_GET['ms_token'])) {
return false;
}
$get_token = $_GET['ms_token'];
if (empty($_POST['confirm'])) {
return false;
}
if ('yes' != $_POST['confirm']) {
return false;
}
$one_time_key = MS_Factory::get_transient('ms_one_time_key-' . $action);
MS_Factory::delete_transient('ms_one_time_key-' . $action);
if (empty($one_time_key)) {
return false;
}
// We verify the current and the previous beat
$plain_token_1 = $action . '-' . date('B') . ':' . get_current_user_id() . '-' . $one_time_key;
$plain_token_2 = $action . '-' . (date('B') - 1) . ':' . get_current_user_id() . '-' . $one_time_key;
if (wp_verify_nonce($get_token, $plain_token_1)) {
return true;
}
if (wp_verify_nonce($get_token, $plain_token_2)) {
return true;
}
return false;
}
示例4: remove_application
/**
* Remove user application for this invitation.
*
* @since 1.0.0
*
* @param int $user_id The user id.
* @param int $membership_id The membership id.
*/
public function remove_application($user_id, $membership_id)
{
$key = self::get_transient_name($user_id, $membership_id);
MS_Factory::delete_transient($key);
$this->remove_invitation_check();
do_action('ms_addon_invitation_model_remove_application', $user_id, $membership_id, $this);
}