本文整理汇总了PHP中ThemexCore::getOption方法的典型用法代码示例。如果您正苦于以下问题:PHP ThemexCore::getOption方法的具体用法?PHP ThemexCore::getOption怎么用?PHP ThemexCore::getOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThemexCore
的用法示例。
在下文中一共展示了ThemexCore::getOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFonts
/**
* Adds custom fonts
*
* @access public
* @return void
*/
public static function renderFonts()
{
$fonts = array();
$out = '';
foreach (ThemexCore::$options as $option) {
if ($option['type'] == 'select_font') {
$font = ThemexCore::getOption($option['id'], $option['default']);
if ($font == 'Open Sans') {
$font .= ':400,600';
} else {
if ($font == 'Asap') {
$font .= ':700';
}
}
$fonts[] = $font;
}
}
if (!empty($fonts)) {
$out .= '<script type="text/javascript">
WebFontConfig = {google: { families: [ "' . implode($fonts, '","') . '" ] } };
(function() {
var wf = document.createElement("script");
wf.src = ("https:" == document.location.protocol ? "https" : "http") + "://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";
wf.type = "text/javascript";
wf.async = "true";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(wf, s);
})();
</script>';
echo $out;
}
}
示例2: esc_attr
" value="<?php
echo esc_attr($value);
?>
" />
</div>
<?php
}
?>
</td>
</tr>
<?php
}
}
?>
<?php
if (!ThemexCore::checkOption('product_variations') && in_array(ThemexCore::getOption('product_type', 'all'), array('all', 'physical'))) {
$options = ThemexWoo::getOptions(ThemexWoo::$data['product']['ID']);
?>
<tr class="trigger-type-physical">
<th><?php
_e('Attributes', 'makery');
?>
</th>
<td>
<div class="element-options" id="attribute">
<?php
$index = 0;
foreach ($options as $option) {
$index++;
?>
<div class="option">
示例3: refresh
/**
* Refreshes module data
*
* @access public
* @return void
*/
public static function refresh()
{
self::$data = (array) ThemexCore::getOption(__CLASS__);
}
示例4: date
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('footer')) {
}
?>
</div>
<?php
}
?>
</div>
</div>
<!-- /content -->
<div class="footer-wrap">
<footer class="site-footer">
<div class="row">
<div class="copyright left">
<?php
echo ThemexCore::getOption('copyright', 'Academy Theme © ' . date('Y'));
?>
</div>
<nav class="footer-navigation right">
<?php
wp_nav_menu(array('theme_location' => 'footer_menu'));
?>
</nav>
<!-- /navigation -->
</div>
</footer>
</div>
<!-- /footer -->
</div>
<!-- /site wrap -->
<?php
示例5: get_header
<?php
/*
Template Name: Posts
*/
get_header();
$layout = ThemexCore::getOption('posts_layout', 'right');
if ($layout == 'left') {
?>
<aside class="sidebar column fourcol">
<?php
get_sidebar();
?>
</aside>
<div class="column eightcol last">
<?php
} else {
if ($layout == 'right') {
?>
<div class="column eightcol">
<?php
} else {
?>
<div class="fullwidth-section">
<?php
}
}
?>
<?php
echo category_description();
?>
示例6: renderFooter
/**
* Renders footer
*
* @access public
* @return void
*/
public static function renderFooter()
{
$out = ThemexCore::getOption('tracking');
echo $out;
}
示例7: resetPassword
/**
* Resets password
*
* @access public
* @param array $data
* @return void
*/
public static function resetPassword($data)
{
global $wpdb, $wp_hasher;
if (email_exists(sanitize_email($data['user_email']))) {
$user = get_user_by('email', sanitize_email($data['user_email']));
do_action('lostpassword_post');
$login = $user->user_login;
$email = $user->user_email;
do_action('retrieve_password', $login);
$allow = apply_filters('allow_password_reset', true, $user->ID);
if (!$allow || is_wp_error($allow)) {
ThemexInterface::$messages[] = __('Password recovery not allowed', 'academy');
} else {
$key = wp_generate_password(20, false);
do_action('retrieve_password_key', $login, $key);
if (empty($wp_hasher)) {
require_once ABSPATH . 'wp-includes/class-phpass.php';
$wp_hasher = new PasswordHash(8, true);
}
$hashed = $wp_hasher->HashPassword($key);
$wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $login));
$link = network_site_url('wp-login.php?action=rp&key=' . $key . '&login=' . rawurlencode($login), 'login');
$message = ThemexCore::getOption('email_password', 'Hi, %username%! Click this link to reset your password %link%');
$keywords = array('username' => $user->user_login, 'link' => $link);
if (themex_mail($email, __('Password Recovery', 'academy'), themex_keywords($message, $keywords))) {
ThemexInterface::$messages[] = __('Password reset link is sent', 'academy');
} else {
ThemexInterface::$messages[] = __('Error sending email', 'academy');
}
}
} else {
ThemexInterface::$messages[] = __('Invalid email address', 'academy');
}
ThemexInterface::renderMessages();
die;
}
示例8: validateQuestion
/**
* Validates lesson question
*
* @access public
* @param array $comment
* @return array
*/
public static function validateQuestion($comment)
{
if (get_post_type() == 'lesson') {
if ($comment['comment_parent'] == 0 && (!isset($_POST['title']) || empty($_POST['title']))) {
wp_die('<strong>' . __('ERROR', 'academy') . '</strong>: ' . __('please type a question.', 'academy'));
}
$message = ThemexCore::getOption('email_question');
if ($comment['comment_parent'] !== 0 && !empty($message)) {
$question = get_comment($comment['comment_parent'], ARRAY_A);
$replies = get_comments(array('parent' => $comment['comment_parent']));
$emails = wp_list_pluck($replies, 'comment_author_email');
if (!empty($question)) {
$emails[] = $question['comment_author_email'];
}
$emails = array_unique(array_filter($emails));
foreach ($emails as $email) {
if ($email != $comment['comment_author_email']) {
$data = get_user_by('email', $email);
if ($data !== false) {
$keywords = array('username' => $data->user_login, 'title' => get_comment_meta($comment['comment_parent'], 'title', true), 'link' => get_comment_link($comment['comment_parent']));
themex_mail($emails, __('Question Answered', 'academy'), themex_keywords($message, $keywords));
}
}
}
}
}
return $comment;
}
示例9: category_description
<div class="column eightcol">
<?php
} else {
?>
<div class="fullcol">
<?php
}
}
?>
<?php
echo category_description();
?>
<div class="shops-wrap clearfix">
<?php
if (is_page()) {
query_posts(array('post_type' => 'shop', 'paged' => themex_paged(), 'posts_per_page' => ThemexCore::getOption('shops_per_page', 6)));
}
$counter = 0;
while (have_posts()) {
the_post();
$counter++;
?>
<div class="column <?php
echo $width;
?>
col <?php
echo $counter == $columns ? 'last' : '';
?>
">
<?php
get_template_part('content', 'shop');
示例10: submitMessage
/**
* Submits user message
*
* @access public
* @param int $ID
* @param array $data
* @return void
*/
public static function submitMessage($ID, $data)
{
$user = intval(themex_value('user_id', $data));
if (!empty($user)) {
$message = sanitize_text_field(themex_value('message', $data));
if (empty($message)) {
ThemexInterface::$messages[] = '"' . __('Message', 'makery') . '" ' . __('field is required', 'makery');
}
if (empty(ThemexInterface::$messages)) {
$subject = __('New Message', 'makery');
$content = ThemexCore::getOption('email_message', 'Sender: %user%<br />Message: %message%');
$receiver = get_userdata($user);
$sender = get_userdata($ID);
$keywords = array('user' => '<a href="' . get_author_posts_url($sender->ID) . '">' . $sender->user_login . '</a>', 'message' => wpautop($message));
$content = themex_keywords($content, $keywords);
themex_mail($receiver->user_email, $subject, $content, $sender->user_email);
ThemexInterface::$messages[] = __('Message has been successfully sent', 'makery');
ThemexInterface::renderMessages(true);
} else {
ThemexInterface::renderMessages();
}
}
die;
}
示例11: submitReport
/**
* Submits shop report
*
* @access public
* @param array $data
* @return void
*/
public static function submitReport($data)
{
$shop = intval(themex_value('shop_id', $data));
if (!empty($shop)) {
$reason = sanitize_text_field(themex_value('reason', $data));
if (empty($reason)) {
ThemexInterface::$messages[] = '"' . __('Reason', 'makery') . '" ' . __('field is required', 'makery');
}
if (empty(ThemexInterface::$messages)) {
$subject = __('Shop Report', 'makery');
$content = ThemexCore::getOption('email_shop_report', 'Sender: %user%<br />Shop: %shop%<br />Reason: %reason%');
$user = get_userdata(get_current_user_id());
$keywords = array('user' => '<a href="' . get_author_posts_url($user->ID) . '">' . $user->user_login . '</a>', 'shop' => '<a href="' . get_permalink($shop) . '">' . get_the_title($shop) . '</a>', 'reason' => wpautop($reason));
$content = themex_keywords($content, $keywords);
themex_mail(get_option('admin_email'), $subject, $content, $user->user_email);
ThemexInterface::$messages[] = __('Report has been successfully sent', 'makery');
ThemexInterface::renderMessages(true);
} else {
ThemexInterface::renderMessages();
}
}
die;
}
示例12: renderBackground
/**
* Renders background
*
* @access public
* @return void
*/
public static function renderBackground()
{
global $post;
$out = '';
if (ThemexCore::getOption('background_type', 'fullwidth') != 'tiled') {
$background = ThemexCore::getOption('background_image', THEME_URI . 'images/bgs/site_bg.jpg');
if (is_page()) {
$background = ThemexCore::getPostMeta($post->ID, 'page_background', $background);
} else {
if (is_singular('course')) {
$background = ThemexCore::getPostMeta($post->ID, 'course_background', $background);
} else {
if (is_singular('lesson')) {
$course = ThemexCore::getPostRelations($post->ID, 0, 'lesson_course', true);
if ($course != 0) {
$background = ThemexCore::getPostMeta($course, 'course_background', $background);
}
}
}
}
$out = '<img src="' . $background . '" class="fullwidth" alt="" />';
}
echo $out;
}
示例13: get_search_form
<?php
}
?>
<?php
}
?>
</div>
<!-- /login options -->
<div class="search-form right">
<?php
get_search_form();
?>
</div>
<!-- /search form -->
<?php
if ($code = ThemexCore::getOption('sharing')) {
?>
<div class="button-wrap share-button tooltip right">
<a href="#" class="element-button dark"><span class="button-icon plus nomargin"></span></a>
<div class="tooltip-wrap">
<div class="corner"></div>
<div class="tooltip-text"><?php
echo themex_html($code);
?>
</div>
</div>
</div>
<!-- /share button -->
<?php
}
?>
示例14: themex_url
<?php
/*
@version 3.0.0
*/
if (!defined('ABSPATH')) {
exit;
}
$view = ThemexCore::getOption('products_view', 'grid');
?>
<div class="items-view left">
<form action="<?php
echo themex_url();
?>
" method="GET" class="woocommerce-ordering">
<?php
if ($view == 'grid') {
?>
<a href="#view" title="<?php
_e('Grid View', 'makery');
?>
" class="element-submit <?php
if (themex_value('view', $_GET, 'grid') == 'grid') {
?>
active<?php
}
?>
" data-value="grid"><span class="fa fa-th-large"></span></a>
<a href="#view" title="<?php
_e('List View', 'makery');
?>
示例15: body_class
?>
</head>
<body <?php
body_class();
?>
>
<div class="site-wrap">
<div class="header-wrap clearfix">
<header class="site-header container">
<div class="header-logo left">
<a href="<?php
echo SITE_URL;
?>
" rel="home">
<img src="<?php
echo ThemexCore::getOption('site_logo', THEME_URI . 'images/logo.png');
?>
" alt="<?php
bloginfo('name');
?>
" />
</a>
</div>
<!-- /logo -->
<div class="header-options right clearfix">
<?php
if (is_user_logged_in()) {
?>
<a href="<?php
echo wp_logout_url(SITE_URL);
?>