本文整理汇总了PHP中weaverx_getopt函数的典型用法代码示例。如果您正苦于以下问题:PHP weaverx_getopt函数的具体用法?PHP weaverx_getopt怎么用?PHP weaverx_getopt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了weaverx_getopt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: weaverx_mce_css
function weaverx_mce_css($default_style)
{
/* replace the default editor-style.css with custom CSS generated on the fly by the php version */
if (weaverx_getopt('_hide_editor_style')) {
return $default_style;
}
$mce_css_file = trailingslashit(get_template_directory()) . 'editor-style-css.php';
$mce_css_dir = trailingslashit(get_template_directory_uri()) . 'editor-style-css.php';
if (!@file_exists($mce_css_file)) {
// see if it is there
return $default_style;
}
/* do we need to do anything about rtl? */
/* if we have a custom style file, return that instead of the default */
// Build the overrides
$put = '?mce=1';
// cheap way to start with ?
if ($twidth = weaverx_getopt_default('theme_width_int', 940)) {
/* figure out a good width - we will please most of the users, most of the time
We're going to assume that mostly people will use the default layout -
we can't actually tell if the editor will be for a page or a post at this point.
And let's just assume the default sidebar widths.
*/
$sb_layout = weaverx_getopt_default('layout_default', 'right');
switch ($sb_layout) {
case 'left':
case 'left-top':
$sb_width = weaverx_getopt_default('left_sb_width_int', 25);
break;
case 'split':
case 'split-top':
$sb_width = weaverx_getopt_default('left_split_sb_width_int', 25) + weaverx_getopt_default('right_split_sb_width_int', 25);
break;
case 'one-column':
$sb_width = 0;
break;
default:
// right
$sb_width = weaverx_getopt_default('right_sb_width_int', 25);
break;
}
$content_w = $twidth - $twidth * (double) ($sb_width / 95.0);
// .95 by trial and error
// calculate theme width based on default layout and width of sidebars.
$put .= '&twidth=' . urlencode($content_w);
}
//if (($val = weaverx_getopt('site_fontsize_int'))) // base font size
// $put .= '&fontsize=' . urlencode($val);
if (($base_font_px = weaverx_getopt('site_fontsize_int')) == '') {
$base_font_px = 16;
}
$base_font_px = (double) $base_font_px;
$font_size = 'default';
if (!is_page() && ($area_font = weaverx_getopt_default('post_font_size', 'default')) != 'default') {
$font_size = $area_font;
} else {
if (($area_font = weaverx_getopt_default('content_font_size', 'default')) != 'default') {
$font_size = $area_font;
} else {
if (($area_font = weaverx_getopt_default('container_font_size', 'default')) != 'default') {
$font_size = $area_font;
} else {
if (($area_font = weaverx_getopt_default('wrapper_font_size', 'default')) != 'default') {
$font_size = $area_font;
}
}
}
}
switch ($font_size) {
// find conversion factor
case 'xxs-font-size':
$h_fontmult = 0.625;
break;
case 'xs-font-size':
$h_fontmult = 0.75;
break;
case 's-font-size':
$h_fontmult = 0.875;
break;
case 'l-font-size':
$h_fontmult = 1.125;
break;
case 'xl-font-size':
$h_fontmult = 1.25;
break;
case 'xxl-font-size':
$h_fontmult = 1.5;
break;
default:
$h_fontmult = 1;
break;
}
$em_font_size = $base_font_px / 16.0 * $h_fontmult;
$put .= '&fontsize=' . $em_font_size;
$val = weaverx_getopt_default('content_font_family', 'default');
if ($val == 'default') {
$val = weaverx_getopt_default('container_font_family', 'default');
}
if ($val == 'default') {
$val = weaverx_getopt('wrapper_font_family');
//.........这里部分代码省略.........
示例2: weaverx_render_infinite_scroll
function weaverx_render_infinite_scroll()
{
$GLOBALS['weaverx_page_who'] = 'blog';
$num_cols = weaverx_getopt('blog_cols');
if (!$num_cols || $num_cols > 3) {
$num_cols = 1;
}
$col = 0;
$masonry_wrap = false;
// need this for one-column posts
/* Start the Loop */
weaverx_post_count_clear();
echo "<div class=\"wvrx-posts\">\n";
while (have_posts()) {
the_post();
weaverx_post_count_bump();
if (!$masonry_wrap) {
$masonry_wrap = true;
if (weaverx_masonry('begin-posts')) {
// wrap all posts
$num_cols = 1;
}
// force to 1 cols
}
weaverx_masonry('begin-post');
// wrap each post
switch ($num_cols) {
case 1:
get_template_part('templates/content', get_post_format());
$sticky_one = false;
break;
case 2:
$col++;
echo '<div class="content-2-col clearfix">' . "\n";
get_template_part('templates/content', get_post_format());
echo "</div> <!-- content-2-col -->\n";
$sticky_one = false;
break;
case 3:
$col++;
echo '<div class="content-3-col clearfix">' . "\n";
get_template_part('templates/content', get_post_format());
echo "</div> <!-- content-3-col -->\n";
$sticky_one = false;
break;
default:
get_template_part('templates/content', get_post_format());
$sticky_one = false;
}
// end switch num cols
weaverx_masonry('end-post');
}
// end while have posts
weaverx_masonry('end-posts');
echo "</div>\n";
}
示例3: weaverx_mainopts_widgets
function weaverx_mainopts_widgets()
{
$opts = array(array('type' => 'submit'), array('name' => __('Sidebar Options', 'weaver-xtreme'), 'id' => '-screenoptions', 'type' => 'header', 'info' => __('Settings affecting main Sidebars and individual widgets', 'weaver-xtreme'), 'help' => 'help.html#WidgetAreas'), array('name' => __('Individual Widgets', 'weaver-xtreme'), 'id' => 'widget', 'type' => 'widget_area', 'info' => __('Properties for individual widgets (e.g., Text, Recent Posts, etc.)', 'weaver-xtreme')), array('name' => __('Widget Title', 'weaver-xtreme'), 'id' => 'widget_title', 'type' => 'titles', 'info' => __('Color for Widget Titles.', 'weaver-xtreme')), array('name' => __('Bar under Widget Titles', 'weaver-xtreme'), 'id' => 'widget_title_underline_int', 'type' => 'val_px', 'info' => __('Enter size in px if you want a bar under Widget Titles. Leave blank or 0 for no bar.', 'weaver-xtreme')), array('name' => __('Widget List Bullet', 'weaver-xtreme'), 'id' => 'widgetlist_bullet', 'type' => 'select_id', 'info' => __('Bullet used for Unordered Lists in Widget areas.', 'weaver-xtreme'), 'value' => array(array('val' => 'disc', 'desc' => __('Filled Disc (default)', 'weaver-xtreme')), array('val' => 'circle', 'desc' => __('Circle', 'weaver-xtreme')), array('val' => 'square', 'desc' => __('Square', 'weaver-xtreme')), array('val' => 'none', 'desc' => __('None', 'weaver-xtreme')))), array('name' => __('Widget Links', 'weaver-xtreme'), 'id' => 'wlink', 'type' => 'link', 'info' => __('Color for links in widgets (uses Standard Link colors if left blank).', 'weaver-xtreme')), array('type' => 'submit'), array('name' => __('Primary Widget Area', 'weaver-xtreme'), 'id' => 'primary', 'type' => 'widget_area_submit', 'info' => __('Properties for the Primary (Upper/Left) Sidebar Widget Area.', 'weaver-xtreme')), array('name' => __('Secondary Widget Area', 'weaver-xtreme'), 'id' => 'secondary', 'type' => 'widget_area_submit', 'info' => __('Properties for the Secondary (Lower/Right) Sidebar Widget Area.', 'weaver-xtreme')), array('name' => __('Top Widget Areas', 'weaver-xtreme'), 'id' => 'top', 'type' => 'widget_area_submit', 'info' => __('Properties for all Top Widget areas (Sitewide, Pages, Blog, Archive).', 'weaver-xtreme')), array('name' => __('Bottom Widget Areas', 'weaver-xtreme'), 'id' => 'bottom', 'type' => 'widget_area', 'info' => __('Properties for all Bottom Widget areas (Sitewide, Pages, Blog, Archive).', 'weaver-xtreme')));
weaverx_form_show_options($opts);
?>
<hr />
<span style="color:blue;"><b>Define Per Page Extra Widget Areas</b></span>
<?php
weaverx_help_link('help.html#PPWidgets', 'Help for Per Page Widget Areas');
?>
<br/>
<small>
<?php
_e('You may define extra widget areas that can then be used in the <em>Per Page</em> settings, or in the <em>Weaver Xtreme Plus</em> [widget_area] shortcode.
Enter a list of one or more widget area names separated by commas.
Your names should include only letters, numbers, or underscores - no spaces or other special characters.
The widgets areas will then appear on the Appearance->Widgets menus.
They can be included on individual pages by adding the name you define here to the "Weaver Xtreme Options For This Page" box on the Edit Page screen. (♦)', 'weaver-xtreme');
?>
</small>
<br />
<?php
weaverx_textarea(weaverx_getopt('_perpagewidgets'), '_perpagewidgets', 1, ' ', $style = 'width:60%;', $class = 'wvrx-edit');
do_action('weaverxplus_admin', 'widget_areas');
}
示例4: weaverx_2_add_fonts
function weaverx_2_add_fonts($fonts)
{
// this code adds all the new Google Fonts to the Legacy plugin Font picker.
$base = array(array('val' => 'inherit', 'desc' => __('Inherit', 'weaver-xtreme')), array('val' => 'open-sans', 'desc' => __('Open Sans', 'weaver-xtreme')), array('val' => 'open-sans-condensed', 'desc' => __('Open Sans Condensed', 'weaver-xtreme')), array('val' => 'alegreya-sans', 'desc' => __('Alegreya Sans', 'weaver-xtreme')), array('val' => 'archivo-black', 'desc' => __('Archivo Black', 'weaver-xtreme')), array('val' => 'arimo', 'desc' => __('Arimo', 'weaver-xtreme')), array('val' => 'droid-sans', 'desc' => __('Droid Sans', 'weaver-xtreme')), array('val' => 'exo-2', 'desc' => __('Exo 2', 'weaver-xtreme')), array('val' => 'lato', 'desc' => __('Lato', 'weaver-xtreme')), array('val' => 'roboto', 'desc' => __('Roboto', 'weaver-xtreme')), array('val' => 'roboto-condensed', 'desc' => __('Roboto Condensed', 'weaver-xtreme')), array('val' => 'source-sans-pro', 'desc' => __('Source Sans Pro', 'weaver-xtreme')), array('val' => 'alegreya', 'desc' => __('Alegreya (Serif)', 'weaver-xtreme')), array('val' => 'arvo', 'desc' => __('Arvo Slab', 'weaver-xtreme')), array('val' => 'droid-serif', 'desc' => __('Droid Serif', 'weaver-xtreme')), array('val' => 'lora', 'desc' => __('Lora', 'weaver-xtreme')), array('val' => 'roboto-slab', 'desc' => __('Roboto Slab', 'weaver-xtreme')), array('val' => 'source-serif-pro', 'desc' => __('Source Serif Pro', 'weaver-xtreme')), array('val' => 'tinos', 'desc' => __('Tinos', 'weaver-xtreme')), array('val' => 'vollkorn', 'desc' => __('Vollkorn', 'weaver-xtreme')), array('val' => 'ultra', 'desc' => __('Ultra Black', 'weaver-xtreme')), array('val' => 'inconsolata', 'desc' => __('Inconsolata (Mono)', 'weaver-xtreme')), array('val' => 'roboto-mono', 'desc' => __('Roboto Mono', 'weaver-xtreme')), array('val' => 'handlee', 'desc' => __('Handlee (Cursive)', 'weaver-xtreme')));
if (!weaverx_getopt('disable_google_fonts')) {
if (!empty($fonts)) {
unset($fonts[0]);
}
// kill original 'default'
return array_merge($base, $fonts);
// put the new fonts at the top
} else {
return $fonts;
}
}
示例5: weaverx_custom_css
function weaverx_custom_css($value = '')
{
$css = weaverx_getopt('add_css');
if (isset($value['id'])) {
$icon = $value['id'];
}
if (!isset($icon) || !$icon) {
$icon = ' ';
}
$dash = '';
if ($icon[0] == '-') {
// add a leading icon
$dash = '<span style="padding:.2em;" class="dashicons dashicons-' . substr($icon, 1) . '"></span>';
}
?>
<tr class="atw-row-header"><td colspan="3">
<a id="custom-css-rules"></a>
<span style="color:black;padding:.2em;" class="dashicons dashicons-screenoptions"></span>
<span style="font-weight:bold; font-size: larger;"><em>
<?php
_e('Custom CSS Rules', 'weaver-xtreme');
?>
<?php
weaverx_help_link('help.html#CustomCSS', __('Custom CSS Rules', 'weaver-xtreme'));
?>
</em></span>
</td></tr>
<tr><td colspan="3">
<!-- ======== -->
<p>
<?php
_e('Rules you add here will be the <em>last</em> CSS Rules included by Weaver Xtreme, and thus override all other Weaver Xtreme generated CSS rules.
Specify complete CSS rules, but don\'t add the <style> HTML element. You can prefix your selectors with <code>.is-desktop, .is-mobile, .is-smalltablet, or .is-phone</code>
to create rules for specific devices.
<strong>NOTE:</strong> Because Weaver Xtreme uses classes on many of its elements, you may to need to use
<em>!important</em> with your rules to force the style override.
It is possible that other plugins might generate CSS that comes after these rules.', 'weaver-xtreme');
?>
</p>
<?php
weaverx_textarea(weaverx_getopt('add_css'), 'add_css', 12, '', 'width:95%;', 'wvrx-edit wvrx-edit-dir');
?>
</td></tr>
<?php
}
示例6: weaverx_add_widget_classes
/**
* Adds the classes to the widget in the front-end
*/
function weaverx_add_widget_classes($params)
{
global $wp_registered_widgets;
$arr_registered_widgets = wp_get_sidebars_widgets();
// Get an array of ALL registered widgets
$sb_id = $params[0]['id'];
// Get the id for the current sidebar we're processing
$widget_id = $params[0]['widget_id'];
// add first, last, even, and odd, and widget classes
$area_map = array('primary-widget-area' => 'primary', 'secondary-widget-area' => 'secondary', 'footer-widget-area' => 'footer', 'sitewide-top-widget-area' => 'top', 'page-top-widget-area' => 'top', 'postpages-widget-area' => 'top', 'blog-top-widget-area' => 'top', 'sitewide-bottom-widget-area' => 'bottom', 'page-bottom-widget-area' => 'bottom', 'blog-bottom-widget-area' => 'bottom', 'header-widget-area' => 'header_sb', 'footer-widget-area' => 'footer_sb', 'primary' => 'primary', 'secondary' => 'secondary', 'widget' => 'widget', 'header' => 'header_sb', 'footer' => 'footer_sb', 'top' => 'top', 'bottom' => 'bottom');
$opt_name = 'widget';
// default styling option name: widget-xxx
$search_sb_id = $sb_id;
if (weaverx_t_get('use_widget_area')) {
// map from replacement area or [extra_widget_area]
$search_sb_id = weaverx_t_get('use_widget_area');
}
foreach ($area_map as $area => $opt) {
// need to find name to use for option values
if ($search_sb_id == $area) {
$opt_name = $opt;
break;
}
}
$cols = weaverx_getopt_default($opt_name . '_cols_int', 1);
if ($cols > 8) {
$cols = 8;
}
// sanity check
$show_number = true;
$show_evenodd = true;
if (!isset($arr_registered_widgets[$sb_id]) || !is_array($arr_registered_widgets[$sb_id])) {
return $params;
}
if (empty($GLOBALS['wvr_widget_number']) || !isset($GLOBALS['wvr_widget_number']) || !$GLOBALS['wvr_widget_number']) {
// global to keep track of which widget this is
$GLOBALS['wvr_widget_number'] = array();
}
if (isset($GLOBALS['wvr_widget_number'][$sb_id])) {
// initialize or bump widget number
$GLOBALS['wvr_widget_number'][$sb_id]++;
} else {
$GLOBALS['wvr_widget_number'][$sb_id] = 1;
}
$is_sidebar = in_array($sb_id, array('primary-widget-area', 'secondary-widget-area'));
// this is a vertical widget
$no_smart = weaverx_getopt($opt_name . '_no_widget_margins');
$is_vert = $cols == 1;
$per_row_tail = $is_vert || $no_smart ? ' ' : '-m ';
$class = '';
$sides = $is_sidebar ? '-b' : '-rb';
$cur_widget = $GLOBALS['wvr_widget_number'][$sb_id];
$widget_count = count($arr_registered_widgets[$sb_id]);
$first = $cur_widget == 1;
$last = $cur_widget == $widget_count;
$def_bottom = 'margin-bottom';
if ($opt_name == 'header_sb') {
$def_bottom = 'no-margin-vertical ';
}
$area_class = weaverx_area_class('widget', 'not-pad', $sides, $def_bottom) . ' ';
if ($area_class) {
$class .= $area_class;
}
if (!$is_vert) {
$class .= 'per-row-' . $cols . $per_row_tail;
$end_of_row = $cur_widget % $cols == 0;
if ($widget_count > 1 && !$end_of_row && !$no_smart) {
$class .= 'smart-rm ';
}
if ($end_of_row) {
$class .= 'end-of-row ';
}
if ($cur_widget % $cols == 1) {
$class .= 'begin-of-row ';
}
}
$class .= 'widget-' . $GLOBALS['wvr_widget_number'][$sb_id] . ' ';
if ($is_vert) {
$widget_first = 'widget-first widget-first-vert ';
$widget_last = 'widget-last widget-last-vert ';
} else {
$widget_first = 'widget-first ';
$widget_last = 'widget-last ';
}
if ($first) {
$class .= $widget_first;
}
if ($last) {
$class .= $widget_last;
}
if ($show_evenodd) {
$widget_even = 'widget-even ';
$widget_odd = 'widget-odd ';
$class .= $cur_widget % 2 ? $widget_odd : $widget_even;
}
// need no-margin-bottom if $cols > 1
$params[0]['before_widget'] = str_replace('">', ' ' . trim($class) . '">', $params[0]['before_widget']);
//.........这里部分代码省略.........
示例7: do_action
// allow anyone to override bradcrumbs via action
do_action('weaverx_paginate');
} else {
if ($pwp || !is_singular()) {
if (function_exists('wp_pagenavi')) {
wp_pagenavi();
} elseif (function_exists('wp_paginate')) {
wp_paginate('title=');
} else {
echo weaverx_get_paginate_archive_page_links('plain', 2, 2);
}
}
}
echo "</span>\n";
}
if (weaverx_getopt('info_search')) {
if (function_exists('weaverxplus_search_form')) {
echo '<span id="infobar_search" style="padding-right:4px !important;display:inline-block;padding-left:20px;">';
echo weaverxplus_search_form('', 120);
echo '</span>';
} else {
echo '<span id="infobar_search">';
get_search_form();
echo '</span>';
}
}
if (weaverx_getopt_checked('info_addlogin')) {
echo '<span id="infobar_login">';
wp_loginout();
echo '</span>';
}
示例8: weaverx_cz_choices_font_family
function weaverx_cz_choices_font_family()
{
$base = array('inherit' => __('Inherit', 'weaver-xtreme'));
$google = array('google' => __('---* Google Fonts (For All Browsers) *', 'weaver-xtreme'), 'sans-g' => __('--- -- Sans-Serif Google Fonts --', 'weaver-xtreme'), 'open-sans' => __('Open Sans', 'weaver-xtreme'), 'open-sans-condensed' => __('Open Sans Condensed', 'weaver-xtreme'), 'alegreya-sans' => __('Alegreya Sans', 'weaver-xtreme'), 'archivo-black' => __('Archivo Black', 'weaver-xtreme'), 'arimo' => __('Arimo', 'weaver-xtreme'), 'droid-sans' => __('Droid Sans', 'weaver-xtreme'), 'exo-2' => __('Exo 2', 'weaver-xtreme'), 'lato' => __('Lato', 'weaver-xtreme'), 'roboto' => __('Roboto', 'weaver-xtreme'), 'roboto-condensed' => __('Roboto Condensed', 'weaver-xtreme'), 'source-sans-pro' => __('Source Sans Pro', 'weaver-xtreme'), 'serif-g' => __('--- -- Serif Google Fonts --', 'weaver-xtreme'), 'alegreya' => __('Alegreya', 'weaver-xtreme'), 'arvo' => __('Arvo Slab', 'weaver-xtreme'), 'droid-serif' => __('Droid Serif', 'weaver-xtreme'), 'lora' => __('Lora', 'weaver-xtreme'), 'roboto-slab' => __('Roboto Slab', 'weaver-xtreme'), 'source-serif-pro' => __('Source Serif Pro', 'weaver-xtreme'), 'tinos' => __('Tinos', 'weaver-xtreme'), 'vollkorn' => __('Vollkorn', 'weaver-xtreme'), 'ultra' => __('Ultra Black', 'weaver-xtreme'), 'mono-g' => __('--- -- Monospace Google Fonts --', 'weaver-xtreme'), 'inconsolata' => __('Inconsolata', 'weaver-xtreme'), 'roboto-mono' => __('Roboto Mono', 'weaver-xtreme'), 'cursive-g' => __('--- -- "Cursive" Google Fonts --', 'weaver-xtreme'), 'handlee' => __('Handlee', 'weaver-xtreme'), 'blank-w' => __('--- ', 'weaver-xtreme'));
$web = array('web' => __('---* Web Fonts *', 'weaver-xtreme'), 'web-hote' => __('--- - May not match on Android/iOS -', 'weaver-xtreme'), 'sans-w' => __('--- -- Sans-Serif Web Fonts --', 'weaver-xtreme'), 'sans-serif' => __('Arial', 'weaver-xtreme'), 'arialBlack' => __('Arial Black', 'weaver-xtreme'), 'arialNarrow' => __('Arial Narrow', 'weaver-xtreme'), 'lucidaSans' => __('Lucida Sans', 'weaver-xtreme'), 'trebuchetMS' => __('Trebuchet MS', 'weaver-xtreme'), 'verdana' => __('Verdana', 'weaver-xtreme'), 'serif-w' => __('--- -- Serif Web Fonts --', 'weaver-xtreme'), 'serif' => __('Times', 'weaver-xtreme'), 'cambria' => __('Cambria', 'weaver-xtreme'), 'garamond' => __('Garamond', 'weaver-xtreme'), 'georgia' => __('Georgia', 'weaver-xtreme'), 'lucidaBright' => __('Lucida Bright', 'weaver-xtreme'), 'palatino' => __('Palatino', 'weaver-xtreme'), 'mono-w' => __('--- -- Monospace Web Fonts --', 'weaver-xtreme'), 'monospace' => __('Courier', 'weaver-xtreme'), 'consolas' => __('Consolas', 'weaver-xtreme'), 'cursive-w' => __('--- -- "Cursive" Web Fonts --', 'weaver-xtreme'), 'papyrus' => __('Papyrus', 'weaver-xtreme'), 'comicSans' => __('Comic Sans MS', 'weaver-xtreme'));
$gfonts = weaverx_getopt_array('fonts_added');
if (!empty($gfonts)) {
foreach ($gfonts as $gfont => $val) {
// $gfont has slug, $val has vals
$base[$gfont] = $val['name'] . ' (' . WEAVERX_PLUS_ICON . 'font)';
}
}
if (!weaverx_getopt('disable_google_fonts')) {
$base = array_merge($base, $google);
}
$base = array_merge($base, $web);
return $base;
}
示例9: weaverx_fi
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
/**
* The template used for displaying page content in page.php
*
* @package WordPress
* @subpackage Weaver X
* @since Weaver Xtreme 1.0
*/
weaverx_fi('page', 'post-before');
$pclass = 'content-page';
$cols = weaverx_get_per_page_value('_pp_page_cols');
if ($cols == '') {
$cols = weaverx_getopt('page_cols');
}
if ($cols != '' && $cols != '1') {
$pclass .= " cols-{$cols}";
}
?>
<article id="post-<?php
the_ID();
?>
" <?php
post_class($pclass);
?>
>
<div class="entry-content clearfix">
<?php
示例10: weaverx_st_pick_theme
function weaverx_st_pick_theme($list_in)
{
// output the form to select a file list from weaverx-subthemes directory
$list = $list_in;
natcasesort($list);
$cur_theme = weaverx_getopt('theme_filename');
if (!$cur_theme) {
$cur_theme = WEAVERX_DEFAULT_THEME;
}
// the default theme
?>
<form enctype="multipart/form-data" name='pick_theme' method='post' onSubmit="return confirm('<?php
_e('Are you sure you want select a new theme?\\r\\n\\r\\nSelecting a new subtheme will overwrite your existing theme settings. You should save your existing settings on the Save/Restore menu if you have made changes.', 'weaver-xtreme');
?>
');" >
<strong><?php
_e('Click a Radio Button below to select a subtheme:', 'weaver-xtreme');
?>
</strong>
<span style="padding-left:100px;"><?php
_e('Current theme:', 'weaver-xtreme');
?>
<strong>
<?php
$cur_addon = weaverx_getopt('addon_name');
if ($cur_addon == '') {
echo ucwords(str_replace('-', ' ', $cur_theme));
} else {
echo __('Add-on Subtheme: ', 'weaver-xtreme') . ucwords(str_replace('-', ' ', $cur_addon));
$cur_theme = '';
}
?>
</strong></span>
<br /><br />
<?php
//weaverx_confirm_select_theme();
?>
<input class="button-primary" name="set_subtheme" type="submit" value="<?php
_e('Set to Selected Subtheme', 'weaver-xtreme');
?>
" />
<p style="color:#b00;font-weight:bold;font-size:120%"><br /><?php
_e('<em>Note:</em> Before switching to any subtheme, you must Save and download a copy of your settings using the Save / Restore page, in order to be able to go back to them if required.', 'weaver-xtreme');
?>
</p>
<?php
weaverx_nonce_field('set_subtheme');
$thumbs = weaverx_relative_url('subthemes/');
foreach ($list as $addon) {
$name = ucwords(str_replace('-', ' ', $addon));
?>
<div style="float:left; width:200px;">
<label><input type="radio" name="theme_picked"
<?php
echo 'value="' . $addon . '" ' . ($cur_theme == $addon ? 'checked' : '') . '/> <strong>' . $name . '</strong><br />';
if (!weaverx_getopt('_hide_theme_thumbs')) {
echo '<img style="border: 1px solid gray; margin: 5px 0px 10px 0px;" src="' . esc_url($thumbs . $addon . '.jpg') . '" width="150px" height="113px" alt="thumb" /></label></div>' . "\n";
} else {
echo "</label></div>\n";
}
}
if (!weaverx_getopt_checked('_hide_theme_thumbs')) {
weaverx_clear_both();
?>
<span class='submit' style='padding-top:6px;'><input class="button-primary" name="set_subtheme" type="submit" value="<?php
_e('Set to Selected Subtheme', 'weaver-xtreme');
?>
" /></span>
<?php
}
?>
</form>
<div style="clear:both;padding-top:6px;"></div>
<form enctype="multipart/form-data" name='hide_thumbs_form' method='post'>
<?php
$hide_msg = weaverx_getopt('_hide_theme_thumbs') ? __('Show Subtheme Thumbnails', 'weaver-xtreme') : __('Hide Subtheme Thumbnails', 'weaver-xtreme');
?>
<input class="button-primary" name="hide_thumbs" type="submit" value="<?php
echo $hide_msg;
?>
" />
<?php
weaverx_nonce_field('hide_thumbs');
?>
</form>
<div style="clear:both;"></div>
<hr />
<?php
do_action('weaverx_child_show_extrathemes');
do_action('weaverxplus_admin', 'show_subthemes');
}
示例11: start_el
/**
* Start the element output.
*/
public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
{
$indent = $depth ? str_repeat("\t", $depth) : '';
$classes = empty($item->classes) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
/**
* Filter the CSS class(es) applied to a menu item's list item element.
*/
$class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth));
$class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
$megamenu = strpos($class_names, 'mega-menu') !== false && function_exists('weaverxplus_plugin_installed');
if ($megamenu) {
$class_names = str_replace('mega-menu', '', $class_names);
}
// have to move it down
/**
* Filter the ID applied to a menu item's list item element.
*/
$id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth);
$id = $id ? ' id="' . esc_attr($id) . '"' : '';
$output .= $indent . '<li' . $id . $class_names . '>';
$atts = array();
$atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
$atts['target'] = !empty($item->target) ? $item->target : '';
$atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
$atts['href'] = !empty($item->url) ? $item->url : '';
/**
* Filter the HTML attributes applied to a menu item's anchor element.
*/
$atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth);
$attributes = '';
$aclass = '';
foreach ($atts as $attr => $value) {
if (!empty($value)) {
$value = 'href' === $attr ? esc_url($value) : esc_attr($value);
if ($attr === 'href' && $value === '#' && weaverx_getopt('placeholder_cursor')) {
$aclass = ' style="cursor:' . weaverx_getopt('placeholder_cursor') . ';"';
}
$attributes .= ' ' . $attr . '="' . $value . '"';
}
}
$item_output = $args->before;
$item_output .= "<a{$attributes}{$aclass}>";
/** This filter is documented in wp-includes/post-template.php */
$item_output .= $args->link_before . do_shortcode(apply_filters('the_title', $item->title, $item->ID)) . $args->link_after;
$item_output .= "</a>";
$item_output .= $args->after;
if ($megamenu) {
$desc = !empty($item->description) ? $item->description : __('Please enter MegaMenu content to Description.', 'weaver-xtreme');
$item_output .= '<ul class="mega-menu"><li>' . do_shortcode($desc) . '</li></ul>';
}
/**
* Filter a menu item's starting output.
*/
$output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
}
示例12: weaverx_put_css_plus
function weaverx_put_css_plus($sout, $id, $tag)
{
if ($style = weaverx_getopt($id . '_css')) {
global $wvrx_css_plus;
$prefix = '';
$suffix = '';
if (is_customize_preview()) {
// Generate a rule that can be easily modified in the DOM
$prefix = "/*-=:{$id}_css:=-*/";
$suffix = "/*-:{$id}_css:-*/";
}
if (strpos($style, '%selector') !== false) {
// user is using $selectors
$tags = explode(',', $tag);
foreach ($tags as $selector) {
$replaced = str_replace('%selector%', trim($selector), $style);
$wvrx_css_plus .= apply_filters('weaverx_css', sprintf("%s%s %s%s\n", $prefix, $selector, $replaced, $suffix));
//weaverx_f_write( $sout, apply_filters( 'weaverx_css', sprintf( "%s%s %s%s\n", $selector, $replaced ) ) );
}
} else {
$wvrx_css_plus .= apply_filters('weaverx_css', sprintf("%s%s %s%s\n", $prefix, $tag, $style, $suffix));
// weaverx_f_write( $sout, apply_filters( 'weaverx_css', sprintf( "%s %s\n", $tag, $style ) ) );
}
}
}
示例13: get_template_part
</div> <?php
}
?>
</nav><!-- #nav-above -->
<?php
get_template_part('templates/content', 'single');
?>
<nav id="nav-below" class="navigation">
<h3 class="assistive-text"><?php
echo __('Post navigation', 'weaver-xtreme');
?>
</h3>
<?php
if (weaverx_getopt('single_nav_style') == 'prev_next') {
?>
<div class="nav-previous"><?php
previous_post_link('%link', __('<span class="meta-nav">←</span> Previous', 'weaver-xtreme'), $cats);
?>
</div>
<div class="nav-next"><?php
next_post_link('%link', __('Next <span class="meta-nav">→</span>', 'weaver-xtreme'), $cats);
?>
</div>
<?php
} else {
?>
<div class="nav-previous"><?php
previous_post_link('%link', '<span class="meta-nav">' . _x('←', 'Previous post link', 'weaver-xtreme') . '</span> %title', weaverx_getopt_checked('single_nav_link_cats'));
?>
示例14: reset_options
public static function reset_options($contents)
{
if (substr($contents, 0, 10) == 'WXT-V01.00') {
$type = 'theme';
} else {
if (substr($contents, 0, 10) == 'WXB-V01.00') {
$type = 'backup';
} else {
$val = substr($contents, 0, 10);
self::$wvrx_error = __("Wrong theme file format version", 'weaver-xtreme') . ':' . $val;
return false;
/* simple check for one of ours */
}
}
$restore = array();
$restore = unserialize(substr($contents, 10));
if (!$restore) {
self::$wvrx_error = __("Unserialize failed", 'weaver-xtreme');
return false;
}
$version = weaverx_getopt('weaverx_version_id');
// get something to force load
$new_cache = array();
global $weaverx_opts_cache;
if ($type == 'theme') {
// need to clear some settings
// first, pickup the per-site settings that aren't theme related...
foreach ($weaverx_opts_cache as $key => $val) {
if (isset($key[0]) && $key[0] == '_') {
// these are non-theme specific settings
$new_cache[$key] = $val;
}
// keep
}
$opts = $restore['weaverx_base'];
// fetch base opts
foreach ($opts as $key => $val) {
if (isset($key[0]) && $key[0] != '_') {
$new_cache[$key] = $val;
}
// and add rest from restore
}
} else {
if ($type == 'backup') {
$opts = $restore['weaverx_base'];
// fetch base opts
foreach ($opts as $key => $val) {
$new_cache[$key] = $val;
// overwrite with saved values
}
}
}
$new_cache['weaverx_version_id'] = $version;
$new_cache['wvrx_css_saved'] = '';
$new_cache['last_option'] = 'Weaver Xtreme';
$new_cache['style_date'] = date('Y-m-d-H:i:s');
delete_option('weaverx_settings');
update_option('weaverx_settings', $new_cache);
$save_dir = weaverx_f_uploads_base_dir() . 'weaverx-subthemes';
$usename = 'style-weaverxt.css';
$filename = $save_dir . '/' . $usename;
@unlink($filename);
$weaverx_opts_cache = $new_cache;
if (weaverx_f_file_access_available()) {
// and now is the time to update the style file
require_once get_template_directory() . '/includes/generatecss.php';
weaverx_fwrite_current_css();
}
return true;
}
示例15: weaverx_ex_set_current_to_serialized_values
function weaverx_ex_set_current_to_serialized_values($contents)
{
global $weaverx_opts_cache;
// need to mess with the cache
if (substr($contents, 0, 10) == 'WXT-V01.00') {
$type = 'theme';
} else {
if (substr($contents, 0, 10) == 'WXB-V01.00') {
$type = 'backup';
} else {
$val = substr($contents, 0, 10);
return weaverx_f_fail(__("Wrong theme file format version", 'weaver-xtreme') . ':' . $val);
/* simple check for one of ours */
}
}
$restore = array();
$restore = unserialize(substr($contents, 10));
if (!$restore) {
return weaverx_f_fail(__("Unserialize failed", 'weaver-xtreme'));
}
$version = weaverx_getopt('weaverx_version_id');
// get something to force load
if ($type == 'theme') {
// need to clear some settings
// first, pickup the per-site settings that aren't theme related...
$new_cache = array();
foreach ($weaverx_opts_cache as $key => $val) {
if (isset($key[0]) && $key[0] == '_') {
// these are non-theme specific settings
$new_cache[$key] = $val;
}
// keep
}
$opts = $restore['weaverx_base'];
// fetch base opts
weaverx_delete_all_options();
foreach ($opts as $key => $val) {
if (isset($key[0]) && $key[0] != '_') {
weaverx_setopt($key, $val, false);
}
// overwrite with saved theme values
}
foreach ($new_cache as $key => $val) {
// set the values we need to keep
weaverx_setopt($key, $val, false);
}
} else {
if ($type == 'backup') {
weaverx_delete_all_options();
$opts = $restore['weaverx_base'];
// fetch base opts
foreach ($opts as $key => $val) {
weaverx_setopt($key, $val, false);
// overwrite with saved values
}
}
}
weaverx_setopt('weaverx_version_id', $version);
// keep version, force save of db
weaverx_setopt('wvrx_css_saved', '');
weaverx_setopt('last_option', 'Weaver Xtreme');
weaverx_save_opts('loading theme');
// OK, now we've saved the options, update them in the DB
return true;
}