本文整理汇总了PHP中weaverii_getopt函数的典型用法代码示例。如果您正苦于以下问题:PHP weaverii_getopt函数的具体用法?PHP weaverii_getopt怎么用?PHP weaverii_getopt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了weaverii_getopt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: weaveriip_search_shortcode
function weaveriip_search_shortcode($args = '')
{
extract(shortcode_atts(array('width' => ''), $args));
$out = '';
$placeholder = weaverii_getopt('wii_search_msg');
if ($placeholder == '') {
$placeholder = 'Search ' . get_bloginfo('name');
}
$use_img = 'images/search_button.gif';
if (weaverii_getopt('wii_go_button')) {
$use_img = 'images/go_button.gif';
}
$imgurl = weaverii_relative_url($use_img);
$use_img = weaverii_getopt('_wii_search_button_url');
if (strlen($use_img) > 0) {
$imgurl = $use_img;
}
$f = '<form role="search" method="get" class="searchform" action="' . home_url('/') . '" >
<section class="search"><label class="screen-reader-text" for="s">' . __('Search for:', 'weaver-ii') . '</label>
<input style="width:' . $width . 'px;" type="search" value="' . get_search_query() . '" name="s" id="s" placeholder="' . $placeholder . '" />
<input class="searchformimg" type="image" src="' . apply_filters('weaverii_css', $imgurl) . '" onsubmit="submit-form();" alt="Search" />
</section>
</form>';
$out .= apply_filters('get_search_form', $f);
return $out;
}
示例2: weaverii_tx_the_footer_late
function weaverii_tx_the_footer_late()
{
if (function_exists('weaverii_getopt')) {
if (weaverii_getopt('use_fitvids')) {
echo "<script type='text/javascript'>jQuery('#wrapper').fitVids();</script>\n";
}
}
}
示例3: weaverii_repeat_row
function weaverii_repeat_row($rid)
{
if (!weaverii_init_base()) {
echo '<tr style="display:none;">';
} else {
echo "\t<tr>\n";
}
?>
<th scope="row" align="right"> </th>
<td colspan="2" style="font-size:80%;">
<input type="radio" name="<?php
weaverii_sapi_main_name($rid);
?>
"
value="repeat" <?php
echo weaverii_getopt($rid) == 'repeat' ? 'checked' : '';
?>
/> repeat
<input type="radio" name="<?php
weaverii_sapi_main_name($rid);
?>
"
value="repeat-x" <?php
echo weaverii_getopt($rid) == 'repeat-x' ? 'checked' : '';
?>
/> repeat-x
<input type="radio" name="<?php
weaverii_sapi_main_name($rid);
?>
"
value="repeat-y" <?php
echo weaverii_getopt($rid) == 'repeat-y' ? 'checked' : '';
?>
/> repeat-y
<input type="radio" name="<?php
weaverii_sapi_main_name($rid);
?>
"
value="no-repeat" <?php
echo weaverii_getopt($rid) == 'no-repeat' ? 'checked' : '';
?>
/> no-repeat
</td>
</tr>
<?php
}
示例4: weaverii_set_current_to_serialized_values
function weaverii_set_current_to_serialized_values($contents)
{
global $weaverii_opts_cache;
// need to mess with the cache
if (substr($contents, 0, 10) == 'W2T-V01.00') {
$type = 'theme';
} else {
if (substr($contents, 0, 10) == 'W2B-V01.00') {
$type = 'backup';
} else {
return weaverii_f_fail(weaverii_t_("Wrong theme file format version"));
}
}
/* simple check for one of ours */
$restore = array();
$restore = unserialize(substr($contents, 10));
if (!$restore) {
return weaverii_f_fail("Unserialize failed");
}
$version = weaverii_getopt('wii_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 ($weaverii_opts_cache as $key => $val) {
if ($key[0] == '_') {
// these are non-theme specific settings
$new_cache[$key] = $val;
}
// keep
}
$opts = $restore['weaverii_base'];
// fetch base opts
weaverii_delete_all_options();
foreach ($opts as $key => $val) {
if ($key[0] != '_') {
weaverii_setopt($key, $val, false);
}
// overwrite with saved theme values
}
foreach ($new_cache as $key => $val) {
// set the values we need to keep
weaverii_setopt($key, $val, false);
}
} else {
if ($type == 'backup') {
weaverii_delete_all_options();
$opts = $restore['weaverii_base'];
// fetch base opts
foreach ($opts as $key => $val) {
weaverii_setopt($key, $val, false);
// overwrite with saved values
}
global $weaverii_pro_opts;
$weaverii_pro_opts = false;
$weaverii_pro_opts = $restore['weaverii_pro'];
weaverii_wpupdate_option('weaverii_pro', $weaverii_pro_opts, 'backup');
}
}
weaverii_setopt('wii_version_id', $version);
// keep version, force save of db
weaverii_setopt('wii_last_option', 'WeaverII');
weaverii_save_opts('loading theme');
// OK, now we've saved the options, update them in the DB
return true;
}
示例5: weaverii_comment_form_reply_filter
function weaverii_comment_form_reply_filter($defaults)
{
$replace = weaverii_getopt('_wii_comment_reply_msg');
if ($replace != '') {
$new = $defaults;
$new['title_reply'] = $replace;
$new['title_reply_to'] = $replace;
return $new;
}
return $defaults;
}
示例6: weaveriip_add_shortcode
function weaveriip_add_shortcode($p1, $p2)
{
if (!weaverii_getopt('_wii_disable_shortcodes') && !function_exists('aspen_swplus_installed')) {
add_shortcode($p1, $p2);
}
}
示例7: weaverii_convert_old_weaver
//.........这里部分代码省略.........
case 'Two, unequal widths, left side':
//Two, unequal widths, left side
weaverii_setopt('wii_layout_default', 'left-2-col', false);
$need_widget_notice = true;
break;
case 'None':
//None
weaverii_setopt('wii_layout_default', 'one-column', false);
break;
case 'Default - One, right side':
//Default - One, right side
//Default - One, right side
default:
weaverii_setopt('wii_layout_default', 'right-1-col', false);
break;
}
break;
}
$need_widget_notice = true;
break;
case '*':
// special handling
$special++;
$converted++;
$new_name = substr($new_name, 1);
switch ($new_name) {
case 'wii_add_css':
case 'wii_add_theme_css':
$manual++;
echo "<span class=\"wvr_red\">CSS Rules detected.</span> The following <em>{$info}</em>\nhave been added to Weaver II's <strong>Custom CSS Rules</strong>, but may require manual changes:\n<br /><span style=\"padding-left:20px;\"><code>" . esc_textarea($val) . "</code></span><br />\n";
$fixed = str_replace('<style>', '', $val);
$fixed = str_replace('<style type="text/css">', '', $fixed);
$fixed = str_replace('</style>', '', $fixed);
$prev = weaverii_getopt('wii_add_css');
if ($prev != '') {
$prev = $prev . "\n" . $fixed;
} else {
$prev = $fixed;
}
weaverii_setopt('wii_add_css', $prev, false);
if (strstr($fixed, '<style') !== false) {
echo "<span class=\"wvr_red\">Warning - unmatched <style> found.</span> You will have to manually\n\t\t\t\t convert the CSS in \"Custom CSS Rules\".\n";
$manual++;
}
break;
case 'wii_content_font':
// Content Font
// Content Font
case 'wii_title_font:':
//Titles Font
echo "<span class=\"wvr_red\">Font settings detected.</span> You may have to manually adjust font selections.<br />\n";
$manual++;
break;
case 'wii_contentlist_bullet':
// Content List Bullet
// Content List Bullet
case 'wii_list_bullet':
// Widget List Bullet
if ($val != 'circle' && $val != 'disc' && $val != 'square') {
$oldval = $val;
$val = 'disc';
if ($oldval != 'default') {
echo "<span class=\"wvr_red\">Additional manual conversion may be required for list bullet:</span> <em>{$info}:\n<br /><span style=\"padding-left:20px;\">" . esc_textarea($oldval) . "</span><br />\n";
}
$manual++;
}
示例8: wp_loginout
$add_div = false;
if ($add_enddiv) {
echo '<br class="mad-br" />';
}
wp_loginout();
$add_enddiv = true;
}
if ($add_enddiv) {
echo '</div>';
}
?>
</nav></div><!-- #access --></div> <!-- #wrap-bottom-menu -->
<?php
} else {
/* ttw - move menu */
if ($show_menu && has_nav_menu($secondary_name) && (!weaverii_use_mobile('phone') || weaverii_use_mobile('phone') && !weaverii_getopt('wii_mobile_hide_secondary_menu'))) {
echo '<div id="wrap-bottom-menu">' . "\n";
weaverii_mobile_menu_bar('mobile-bottom-nav', 'nav-bottom-menu', 'no-home');
?>
<div id="nav-bottom-menu"<?php
echo $nav_class;
?>
><nav id="access2" class="menu_bar" role="navigation">
<?php
if (weaverii_use_sf()) {
wp_nav_menu(array('theme_location' => $secondary_name, 'fallback_cb' => '', 'menu_class' => 'sf-menu', 'container_class' => 'menu'));
} else {
wp_nav_menu(array('theme_location' => $secondary_name, 'fallback_cb' => '', 'container_class' => 'menu'));
}
?>
</nav></div><!-- #access2 --></div> <!-- #wrap-bottom-menu -->
示例9: weaverii_post_count_clear
?>
<div id="content" role="main">
<?php
weaverii_post_count_clear();
$cats = weaverii_getopt_checked('wii_single_nav_link_cats');
while (have_posts()) {
the_post();
?>
<nav id="nav-above" class="navigation">
<h3 class="assistive-text"><?php
echo __('Post navigation', 'weaver-ii');
?>
</h3>
<?php
if (weaverii_getopt('wii_single_nav_style') == 'prev_next') {
?>
<div class="nav-previous"><?php
previous_post_link('%link', __('<span class="meta-nav">←</span> Previous', 'weaver-ii'), $cats);
?>
</div>
<div class="nav-next"><?php
next_post_link('%link', __('Next <span class="meta-nav">→</span>', 'weaver-ii'), $cats);
?>
</div>
<?php
} else {
?>
<div class="nav-previous"><?php
previous_post_link('%link', '<span class="meta-nav">' . _x('←', 'Previous post link', 'weaver-ii') . '</span> %title', $cats);
?>
示例10: weaverii_fix_IE
function weaverii_fix_IE()
{
/* Design note: This conditional IE support code is injected directly into the header. This is consistent
with the fact that the main custom CSS is also normally injected into the header, and the fact that it
needs to include the PIE script using 'get_template_directory_uri' which will not be the same for all
installations and all versions of Weaver II.
*/
$add_PIE = !weaverii_getopt('_wii_hide_PIE');
echo "\n";
if ($add_PIE) {
weaverii_bake_PIE();
}
}
示例11: weaverii_get_header_action
function weaverii_get_header_action()
{
$code = weaverii_getopt('_phpactions');
if ($code) {
eval($code);
}
}
示例12: weaverii_perform_check
function weaverii_perform_check()
{
?>
<div style="background:#FFFF88;border:3px solid green;font-size:larger;padding:0 10px 0 10px; width:80%;margin-top:15px;margin-bottom:10px;">
<p style="font-weight:normal;"><strong>Checking Weaver II for possible problems.</strong> This will check for some potential problems, but it is
not a comprehensive check. Most messages are informational warnings, but things that should be fixed are marked ERROR.</p>
<ul style="list-style-type:disc;list-style-position:inside;">
<?php
echo '<li>' . weaverii_check_version(true) . "</li>\n";
// version
global $wp_version;
// see about file system
if (function_exists('get_filesystem_method')) {
// this is available to check
$type = get_filesystem_method(array());
// lets see if we have direct or ftpx
if ($type == 'ftpext') {
// supposed to be using ftp access
?>
<li>Please note: your site server is configured so that WordPress requires "FTP File Access" to update themes,
plugins, and other files. If your site host is a private server, VPS, or other system where your site is secure from other
users, <em>this is not an issue</em>. If, on the other hand, your site is using shared hosting, then it might
be vulnerable to attack from other users who share your server. We <strong>strongly</strong> advise that you contact
your hosting company and see if your site can be configured more securely, and if not, change hosting companies.
Most modern shared hosting companies can provide "suPHP", "fastCGI", or other tools that allow shared
serving without compromising file security.
<?php
if (weaverii_init_base()) {
?>
<br /><br />
For Weaver II Pro, the "FTP File Access" requirement may cause issues with creating css and saved-settings files.
You may want to add FTP credentials to your wp-config.php file.
<?php
}
?>
</li>
<?php
}
}
if (!weaverii_init_base() && !function_exists('weaverii_extras_shortcodes_installed')) {
echo "<li><strong>WARNING:</strong> You do not have the <em>Weaver II Theme Extras</em> plugin\n\t\tinstalled. It provides important and useful shortcodes for Weaver II. Please open the\n\t\t<strong>Shortcodes/Plugins</strong> tab for more information.</li>";
}
// option combinations
if (weaverii_getopt('wii_wrap_shadow') && !weaverii_getopt('wii_page_bgcolor')) {
// MUST have wrapper page bg set
?>
<li><span style="color:red;font-weight:bold">ERROR:</span> You have specified "Wrap site with shadow" but
have not provided a backgroud color for "Wrapper Page BG". This combination may not display correctly
on IE7 and IE8. Please provide a Wrapper Page BG color.</li>
<?php
}
// plugins
weaverii_check_cache_plugins('<li>', '</li>');
// Cache check
weaverii_check_mobile_plugins('<li>', '</li>');
// Check for mobile plugin themes
$seo = '';
if (function_exists('aioseop_get_version')) {
$seo = 'All in One SEO Pack';
}
if (function_exists('su_wp_incompat_notice')) {
$seo = 'SEO Ultimate';
}
if (class_exists('gregsHighPerformanceSEO')) {
$seo = 'Greg\'s High Performance SEO';
}
if (class_exists('EcordiaContentOptimizer')) {
$seo = 'Scribe SEO';
}
if ($seo) {
echo '<li>You are using the SEO plugin <em>' . $seo . '</em>';
'</em>. Be sure you have filled in the SEO plugin settings</li>';
}
if (function_exists('wpseo_get_value')) {
echo '<li>NOTICE: You are using "WordPress SEO by Yoast". Weaver II automatically supports
this plugin. Be sure you have filled in the plugin settings.</li>';
$seo = 'Yoast';
}
if (!$seo) {
echo '<li>None of the most popular SEO plugins have been activated. You might want to consider using "WordPress SEO by Yoast", for example.</li>';
}
// widgets
if (is_active_sidebar('header-widget-area')) {
// have an active horizontal header area
if (weaverii_getopt('_wii_hdr_widg_1_w_int') == '') {
// just check the first one
?>
<li><span style="color:red;font-weight:bold">ERROR:</span> You have added widgets for the <em>Header Horizontal Widget Area</em>, but have not
properly defined widths for the widgets in that area. (Main Options:Header:Header Widget Area Widgets:Widths) </li>
<?php
}
}
if (!is_active_sidebar('primary-widget-area') && !is_active_sidebar('right-widget-area') && !is_active_sidebar('left-widget-area')) {
echo '<li>You have not added any <em>widgets</em> to the <em>standard</em> sidebar widget areas. This check does not include any alternate
replacement widget areas. (Dashboard:Widgets)</li>';
}
// misc
$saved = get_option(apply_filters('weaver_options', 'weaverii_settings_backup'));
if (empty($saved)) {
echo '<li>You have not saved your settings using the <em>Save/Restore</em> tab. It is good practice to keep a saved version of your settings.</li>';
//.........这里部分代码省略.........
示例13: weaveriip_posted_on_code
function weaveriip_posted_on_code($date, $author)
{
if (weaverii_getopt('wii_post_info_hide_top') || weaverii_is_checked_page_opt('wvp_perpost_info_hide_top')) {
return '';
}
$leftm = '8';
$on = "\t<div class=\"entry-meta\" style=\"margin-botom:-5px;margin-top:-10px;\"><div " . weaverii_meta_icons_class() . ">\n\t\t";
$on .= '<span class="sep">Posted on </span><time class="entry-date" >' . $date . '<span class="by-author"> <span class="sep"> by </span> <span class="author vcard">' . $author . '</span></span>';
$on .= "\n </div></div><!-- .entry-meta -->\n";
return $on;
}
示例14: weaverii_activate_subtheme
function weaverii_activate_subtheme($theme)
{
/* load settings for specified theme */
global $weaverii_opts_cache;
/* build the filename - theme files stored in /wp-content/themes/weaverii/subthemes/
Important: the following code assumes that any of the pre-defined theme files won't have
and end-of-line character in them, which should be true. A user could muck about with the
files, and possibly break this assumption. This assumption is necessary because the WP
theme rules allow file(), but not file_get_contents(). Other than that, the following code
is really the same as the 'theme' section of weaverii_upload_theme() in the pro library
*/
$filename = get_template_directory() . '/subthemes/' . $theme . '.w2t';
$contents = weaverii_f_get_contents($filename);
// use either real (pro) or file (standard) version of function
if (empty($contents)) {
return false;
}
if (substr($contents, 0, 10) != 'W2T-V01.00') {
return false;
}
$restore = array();
$restore = unserialize(substr($contents, 10));
if (!$restore) {
return false;
}
$version = weaverii_getopt('wii_version_id');
// get something to force load
// need to clear some settings
// first, pickup the per-site settings that aren't theme related...
$new_cache = array();
foreach ($weaverii_opts_cache as $key => $val) {
if ($key[0] == '_') {
// these are non-theme specific settings
$new_cache[$key] = $weaverii_opts_cache[$key];
// clear
}
}
$opts = $restore['weaverii_base'];
// fetch base opts
weaverii_delete_all_options();
foreach ($new_cache as $key => $val) {
// set the values we need to keep
weaverii_setopt($key, $new_cache[$key], false);
}
foreach ($opts as $key => $val) {
if ($key[0] == '_') {
continue;
}
// should be here
weaverii_setopt($key, $val, false);
// overwrite with saved theme values
}
weaverii_setopt('wii_version_id', WEAVERII_VERSION, false);
weaverii_setopt('wii_theme_filename', $theme, false);
weaverii_setopt('wii_style_version', 1, false);
weaverii_setopt('wii_last_option', 'WeaverII');
// assume always ok if from file
weaverii_save_opts('set subtheme');
// OK, now we've saved the options, update them in the DB
return true;
}
示例15: weaverii_sc_info
function weaverii_sc_info()
{
global $current_user;
$out = '<strong>' . WEAVERII_THEMEVERSION . ' Info</strong><hr />';
get_currentuserinfo();
if (isset($current_user->display_name)) {
$out .= '<em>User:</em> ' . $current_user->display_name . '<br />';
}
$out .= ' ' . wp_register('', '<br />', false);
$out .= ' ' . wp_loginout('', false) . '<br />';
global $weaverii_mobile;
$device = $weaverii_mobile;
$out .= '<em>Browser:</em> ' . ($device ? $device['browser'] . '/' . $device['type'] . '/' . $device['os'] : 'Non-Mobile Browser') . '<br />';
$agent = 'Not Available';
if (isset($_SERVER["HTTP_USER_AGENT"])) {
$agent = $_SERVER['HTTP_USER_AGENT'];
}
$out .= '<em>User Agent</em>: <small>' . $agent . '</small>';
$out .= '<div id="example"></div>
<script type="text/javascript">
var txt = "";
var myWidth;
if( typeof( window.innerWidth ) == "number" ) {
//Non-IE
myWidth = window.innerWidth;
} else if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in "standards compliant mode"
myWidth = document.documentElement.clientWidth;
} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
}
txt+= "<em>Browser Width: </em>" + myWidth + " px<br>";
document.getElementById("example").innerHTML=txt;
</script>';
if (!weaverii_use_inline_css(weaverii_get_css_filename())) {
$out .= '<em>Using CSS file:</em> ' . weaverii_get_css_filename();
} else {
$out .= '<em>Using Inline CSS</em>';
}
$out .= '<br /><em>Mobile Mode: </em> ' . weaverii_getopt('_wii_mode_mobile');
$out .= '<br /><em>Feed title:</em> ' . get_bloginfo_rss('name') . get_wp_title_rss();
$out .= '<br /><em>You are using</em> WordPress ' . $GLOBALS['wp_version'] . '<br /><em>PHP Version:</em> ' . phpversion();
$out .= '<br /><em>Memory:</em> ' . round(memory_get_usage() / 1024 / 1024, 2) . 'M of ' . (int) ini_get('memory_limit') . 'M <hr />';
return $out;
}