本文整理汇总了PHP中op_default_attr函数的典型用法代码示例。如果您正苦于以下问题:PHP op_default_attr函数的具体用法?PHP op_default_attr怎么用?PHP op_default_attr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了op_default_attr函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_settings
function display_settings($section_name, $config = array())
{
?>
<div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar">
<label for="op_<?php
echo $section_name;
?>
_link_text" class="form-title"><?php
_e('Link text', OP_SN);
?>
</label>
<p class="op-micro-copy"><?php
_e('Enter the Continue Reading link text for your blog. To add arrows to your link use &rarr;', OP_SN);
?>
</p>
<input type="text" id="op_<?php
echo $section_name;
?>
_link_text" name="op[<?php
echo $section_name;
?>
][link_text]" value="<?php
echo op_default_attr($section_name, 'link_text');
?>
" />
</div>
<?php
}
示例2: save_page_template
function save_page_template($post_id)
{
if (!op_can_edit_page($post_id) || !isset($_POST['op_page_template']) || !wp_verify_nonce($_POST['op_page_template'], 'op_page_template')) {
return;
}
$remove = true;
$cur_tpl = op_default_attr('column_layout', 'option');
if ($tpl = op_post('op_page_tpl_file')) {
if ($cur_tpl != $tpl) {
update_post_meta($post_id, '_op_page_template', $tpl);
$remove = false;
}
}
if ($remove) {
delete_post_meta($post_id, '_op_page_template');
}
}
示例3: printf
" class="form-title"><?php
printf(__('Column %1$s', 'optimizepress'), $i);
?>
</label>
<p class="op-micro-copy"><?php
printf(__('Set the width for column %1$s of your blog footer.', 'optimizepress'), $i) . ($i == 1 ? _e(' This will be the left-most column', 'optimizepress') : '');
?>
</p>
<input type="text" name="<?php
echo $fieldname . '[' . $i . ']';
?>
" id="<?php
echo $fieldid . $i;
?>
" value="<?php
echo op_default_attr('footer_prefs', 'widths', $i);
?>
" />
<?php
// op_default_link($fieldid.$i,op_theme_config($default_arr,$i))
?>
<?php
if ($error = $this->error('op_sections_footer_prefs_widths_' . $i)) {
?>
<span class="error"><?php
echo $error;
?>
</span>
<?php
}
示例4: _e
" class="form-title"><?php
_e($field['title'], 'optimizepress');
?>
</label>
<p class="op-micro-copy"><?php
printf(__('Enter the width of your sidebar. Enter a value between %1$s and %2$s or click Default to restore default setting', 'optimizepress'), op_get_var($field, 'min', 230), op_get_var($field, 'max', 400));
?>
</p>
<input type="text" name="<?php
echo $fieldname . '[' . $name . ']';
?>
" id="<?php
echo $fieldid . $name;
?>
" value="<?php
echo op_default_attr('column_layout', 'widths', $name);
?>
" />
<?php
op_default_link($fieldid . $name, op_theme_config($default_arr, $name));
?>
<?php
if ($error = $this->error('op_sections_column_layout_withs_' . $name)) {
?>
<span class="error"><?php
echo $error;
?>
</span>
<?php
示例5: _e
_e('Upload a Banner Image', OP_SN);
?>
</label>
<p class="op-micro-copy"><?php
_e('Upload a header image');
?>
</p>
<?php
op_upload_field('op[sections][header_logo_setup][bgimg]', op_default_option('header_logo_setup', 'bgimg'));
?>
<div class="clear"></div>
<label for="op_sections_header_logo_setup_repeatbgimg" class="form-title"><?php
_e('Upload Repeating Header Image', OP_SN);
?>
</label>
<p class="op-micro-copy"><?php
_e('This would normally be a gradient. Upload a repeating header background image which will be tiled horizontally on your header. We recommend you use a gradient of your choice which is 1px by 250px or the same height as the banner image above if you have uploaded one', OP_SN);
?>
</p>
<?php
op_upload_field('op[sections][header_logo_setup][repeatbgimg]', op_default_option('header_logo_setup', 'repeatbgimg'));
?>
<label><?php
_e('or Choose a header background colour', OP_SN);
?>
</label>
<?php
op_color_picker('op[sections][header_logo_setup][bgcolor]', op_default_attr('header_logo_setup', 'bgcolor'), 'op_header_logo_setup');
?>
</div>
示例6: _e
<div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar">
<label for="op_copyright_notice" class="form-title"><?php
_e('Copyright Notice (Displayed in the Footer)', OP_SN);
?>
</label>
<p class="op-micro-copy"><?php
_e('Enter a copyright notice to be used in the footer of your site. Use &copy; for the © symbol', OP_SN);
?>
</p>
<input type="text" name="op[sections][copyright_notice]" id="op_copyright_notice" value="<?php
echo op_default_attr('copyright_notice');
?>
" />
</div>
示例7: op_default_attr
<script>
(function ($) {
<?php
$fbAppId = op_default_attr('comments', 'facebook', 'id') ? 'appId: ' . op_default_attr('comments', 'facebook', 'id') . ',' : '';
?>
if (typeof window.fbAsyncInit === 'undefined') {
window.fbAsyncInit = function() {
FB.init({
<?php
echo $fbAppId;
?>
xfbml : true,
version : 'v2.0'
});
// if (typeof $ !== 'undefined') {
$(window).trigger("OP.fbAsyncInit");
// }
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/<?php
echo $fb_lang;
?>
/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
示例8: get_header
<?php
get_header();
?>
<?php
$class = op_default_attr('column_layout', 'option');
?>
<div class="main-content content-width cf <?php
echo $class;
?>
" style="display:none;">
<div class="main-content-area-container cf">
<div class="sidebar-bg"></div>
<div class="main-content-area">
<?php
op_mod('advertising')->display(array('advertising', 'home_page', 'top'));
?>
<?php
if (have_posts()) {
if (is_paged()) {
op_theme_file('loop');
} else {
$postslist = get_posts(array('numberposts' => 1));
foreach ($postslist as $post) {
setup_postdata($post);
$has_img = has_post_thumbnail();
?>
<div class="title-home latest-post<?php
echo $has_img ? '' : ' no-post-image';
?>
示例9: op_default_attr
include 'style.inc.php';
?>
<script id="js_<?php
echo $id;
?>
">
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/<?php
echo $fb_lang;
?>
/all.js#xfbml=1&appId=<?php
echo op_default_attr('comments', 'facebook', 'id');
?>
";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
window.fbAsyncInit = function(){
FB.Event.subscribe('edge.create', function(response) {
jQuery('#<?php
echo $id;
?>
span:first-of-type').height((jQuery('#<?php
echo $id;
?>
span:first-of-type').height() + 145) + 'px');
});
示例10: social_sharing
static function social_sharing($atts)
{
global $post;
$page_id = defined('OP_PAGEBUILDER_ID') ? OP_PAGEBUILDER_ID : $post->ID;
$url = get_permalink($page_id);
// Decode encoded chars
$atts = op_urldecode($atts);
$data = shortcode_atts(array('style' => 'horizontal', 'fb_like_url' => $url, 'fb_color' => 'light', 'fb_lang' => op_default_attr('comments', 'facebook', 'language'), 'fb_text' => 'Like', 'fb_button_text' => 'Share', 'tw_text' => 'Share', 'tw_lang' => 'en', 'tw_url' => $url, 'tw_button_text' => 'Share', 'tw_name' => '', 'g_url' => $url, 'g_lang' => 'en-GB', 'g_button_text' => 'Share', 'p_url' => $url, 'p_image_url' => $url, 'p_description' => '', 'su_url' => $url, 'linkedin_url' => $url, 'linkedin_lang' => 'en_US', 'alignment' => 'center'), $atts);
extract($data);
$attrs = $style == 'horizontal' ? array('fb_button_style' => 'button_count', 'fb_extra' => ' data-width="89"', 'tw_extra' => ' style="width:98px"', 'g_size' => 'medium', 'g_extra' => ' style="width:85px"', 'su_style' => '1', 'p_extra' => ' data-pin-config="beside"') : array('fb_extra' => '', 'fb_button_style' => 'box_count', 'tw_extra' => ' data-count="vertical"', 'g_size' => 'tall', 'su_style' => '5', 'g_extra' => '', 'p_extra' => ' data-pin-config="above"');
$data['id'] = 'social-sharing-' . op_generate_id();
//Init Facebook html
$fbAppId = op_default_attr('comments', 'facebook', 'id') ? 'appId: ' . op_default_attr('comments', 'facebook', 'id') . ',' : '';
$data['fb_html'] = '
<script>
window.fbAsyncInit = function() {
FB.init({
' . $fbAppId . '
xfbml : true,
version : \'v2.0\'
});
opjq(window).trigger("OP.fbAsyncInit");
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/' . $fb_lang . '/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, \'script\', \'facebook-jssdk\'));
if (typeof FB !== "undefined") { FB.XFBML.parse(); }
</script>
<div class="fb-like" data-send="false"' . ($fb_like_url != '' ? ' data-href="' . $fb_like_url . '"' : '') . ' data-layout="' . $attrs['fb_button_style'] . '" data-show-faces="false" data-action="' . $fb_text . '" data-colorscheme="' . $fb_color . '"' . $attrs['fb_extra'] . '></div>
';
//Init Twitter html
$data['twitter_html'] = '
<a href="https://twitter.com/share" class="twitter-share-button"' . (ucfirst($tw_text) != '' ? ' data-text="' . op_attr($tw_text) . '"' : '') . ($tw_url != '' ? ' data-url="' . op_attr($tw_url) . '"' : '') . ($tw_name != '' ? ' data-via="' . op_attr($tw_name) . '"' : '') . ' data-lang="' . $tw_lang . '"' . $attrs['tw_extra'] . '>' . __('Tweet', OP_SN) . '</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<script>
if (typeof twttr === "object"
&& typeof twttr.widgets === "object"
&& typeof twttr.widgets.load === "function") {
try {
twttr.widgets.load();
} catch(e) {}
}
</script>
';
//Init Google+ html
$data['gplus_html'] = '
<div class="g-plusone" data-size="' . $attrs['g_size'] . '" data-href="' . $g_url . '"' . $attrs['g_extra'] . '></div>
<script type="text/javascript">
window.___gcfg = {lang: \'' . $g_lang . '\'};
(function() {
var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
po.src = \'https://apis.google.com/js/plusone.js\';
var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
';
//Init Pinterest html
// $data['pinterest_html'] = '
// <span class="pinbreak"><a href="http://pinterest.com/pin/create/button/?url='.$p_url.'&media='.$p_image_url.($p_description!=''?'&description='.$p_description:'').'" class="pin-it-button" data-pin-do="buttonPin" count-layout="'.$style.'"'.$attrs['p_extra'].'><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="'.__('Pin It',OP_SN).'" /></a></span>
// <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
// ';
$data['pinterest_html'] = '
<span class="pinbreak"><a href="http://pinterest.com/pin/create/button/?url=' . $p_url . '&media=' . $p_image_url . ($p_description != '' ? '&description=' . $p_description : '') . '" class="pin-it-button" data-pin-do="buttonPin" ' . $attrs['p_extra'] . '><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="' . __('Pin It', OP_SN) . '" /></a></span>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
<script>
if (typeof window.parsePinBtns === "function") {
window.parsePinBtns();
}
</script>
';
//Init StumbleUpon html
$data['su_html'] = '
<div class="op-stumbleupon-badge">
<su:badge layout="' . $attrs['su_style'] . '" location="' . $su_url . '"></su:badge>
<script type="text/javascript">
(function() {
var li = document.createElement(\'script\'); li.type = \'text/javascript\'; li.async = true;
li.src = (\'https:\' == document.location.protocol ? \'https:\' : \'http:\') + \'//platform.stumbleupon.com/1/widgets.js\';
var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(li, s);
})();
</script>
</div>
';
//Init LinkedIn html
$data['linkedin_html'] = '
<script src="//platform.linkedin.com/in.js" type="text/javascript">
lang: ' . $linkedin_lang . '
</script>
<script type="IN/Share" data-url="' . $linkedin_url . '" data-counter="top"></script>
<script>
if (typeof IN === "object" && typeof IN.parse === "function") {
IN.parse();
}
</script>
//.........这里部分代码省略.........
示例11: op_default_attr
$top_nav_font = op_default_attr('color_scheme_fields', $name);
op_font_selector('op[sections][color_scheme_fields][' . $name . ']', array('family' => $top_nav_font['font_family'], 'style' => $top_nav_font['font_weight'], 'size' => $top_nav_font['font_size'], 'shadow' => $top_nav_font['font_shadow']), '<div class="op-micro-copy-font-selector">', '</div>', false);
?>
</li>
<?php
} else {
?>
<li>
<label for="op_sections_color_scheme_field_<?php
echo $name;
?>
" class="form-title"><?php
echo $title;
?>
</label>
<?php
echo empty($help) ? '' : '<p class="op-micro-copy">' . $help . '</p>';
op_color_picker('op[sections][color_scheme_fields][' . $name . ']', op_default_attr('color_scheme_fields', $name), 'op_sections_color_scheme_field_' . $name);
?>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<?php
}
?>
</div>
示例12: _e
_e('Hosted elsewhere? Paste the link below', 'optimizepress');
?>
</label>
<input type="text" name="<?php
echo $fieldname;
?>
[imgurl]" id="<?php
echo $id;
?>
imgurl" value="<?php
echo op_default_attr($section_name, $tab, $name, 'imgurl');
?>
" />
<label for="<?php
echo $id;
?>
href" class="form-title"><?php
_e('Where do you wish this advertisement to link to?', 'optimizepress');
?>
</label>
<input type="text" name="<?php
echo $fieldname;
?>
[href]" id="<?php
echo $id;
?>
href" value="<?php
echo op_default_attr($section_name, $tab, $name, 'href');
?>
" />
示例13: foreach
<?php
foreach ($content_fields as $name => $field) {
?>
<p>
<label for="<?php
echo $id;
?>
content_<?php
echo $name;
?>
"><?php
echo $field['name'];
?>
</label>
<?php
switch ($field['type']) {
case 'textarea':
echo '<textarea name="' . $fieldname . '[content][' . $name . ']" id="' . $id . 'content_' . $name . '">' . op_default_attr($section_name, 'content', $name) . '</textarea>';
break;
default:
echo '<input type="text" name="' . $fieldname . '[content][' . $name . ']" id="' . $id . 'content_' . $name . '" value="' . op_default_attr($section_name, 'content', $name) . '" />';
break;
}
?>
</p>
<?php
}
示例14: asset_js
function asset_js()
{
$languages = $this->_get_facebook_languages();
$vars = array('appid' => 'id', 'title' => 'title', 'lang' => 'language', 'hide_like' => 'hide_like', 'dark_site' => 'dark_site', 'posts_number' => 'posts_number', 'src_url' => 'src_url');
$options = array();
foreach ($vars as $var => $prop) {
$options[$var] = $this->default_attr('comments', 'facebook', $prop);
if (empty($options[$var])) {
$options[$var] = op_default_attr('comments', 'facebook', $prop);
}
}
$options['lang'] = op_get_current_item($languages, $options['lang']);
echo '
var op_fb_comments_asset = ' . json_encode(array('languages' => $languages, 'options' => $options)) . ';';
}