本文整理汇总了PHP中ThemexCore::getRewriteRule方法的典型用法代码示例。如果您正苦于以下问题:PHP ThemexCore::getRewriteRule方法的具体用法?PHP ThemexCore::getRewriteRule怎么用?PHP ThemexCore::getRewriteRule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThemexCore
的用法示例。
在下文中一共展示了ThemexCore::getRewriteRule方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_title
>
<head>
<title><?php
wp_title('|', true, 'right');
?>
</title>
<?php
wp_head();
?>
</head>
<body <?php
body_class('single-certificate');
?>
>
<?php
$ID = ThemexCore::getRewriteRule('certificate');
$certificate = ThemexCourse::getCertificate(themex_decode($ID), themex_decode($ID, true));
if (isset($certificate['user'])) {
?>
<div class="certificate-wrap">
<?php
if (!empty($certificate['background'])) {
?>
<div class="substrate">
<img src="<?php
echo $certificate['background'];
?>
" class="fullwidth" alt="" />
</div>
<?php
}
示例2: redirectCourse
/**
* Redirects course or plan
*
* @access public
* @return void
*/
public static function redirectCourse()
{
$ID = ThemexCore::getRewriteRule('redirect');
if (!empty($ID)) {
$post = get_post($ID);
if (!empty($post)) {
if ($post->post_type == 'plan') {
self::subscribeUser($post->ID, get_current_user_id());
} else {
if ($post->post_type == 'course') {
self::addUser($post->ID, get_current_user_id());
}
}
}
wp_redirect(SITE_URL);
exit;
}
}
示例3: saveAttachment
/**
* Saves lesson attachment
*
* @access public
* @return void
*/
public static function saveAttachment()
{
$file = ThemexCore::getRewriteRule('file');
if (!empty($file)) {
$index = themex_decode($file);
$lesson = themex_decode($file, true);
self::refresh($lesson);
if (!empty(self::$data['course'])) {
ThemexCourse::refresh(self::$data['course']);
if (isset(self::$data['attachments'][$index]) && (ThemexCourse::isSubscriber() && ThemexCourse::isMember() || ThemexCourse::isAuthor() || self::$data['status'] == 'free')) {
$attachment = self::$data['attachments'][$index];
if (isset($attachment['status']) && $attachment['status'] == 'link') {
wp_redirect($attachment['url']);
} else {
$name = basename($attachment['url']);
header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: Binary');
header('Content-disposition: attachment; filename="' . $name . '"');
readfile($attachment['url']);
}
} else {
wp_redirect(get_permalink(self::$data['course']));
}
exit;
}
wp_redirect(SITE_URL);
exit;
}
}