本文整理汇总了PHP中beans_open_markup函数的典型用法代码示例。如果您正苦于以下问题:PHP beans_open_markup函数的具体用法?PHP beans_open_markup怎么用?PHP beans_open_markup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了beans_open_markup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fast_monkey_search_content
function fast_monkey_search_content($content)
{
$output = beans_open_markup('fast_monkey_search_content', 'p');
$output .= beans_output('fast_monkey_search_post_content', substr(strip_tags($content), 0, 150) . ' ...');
$output .= beans_close_markup('fast_monkey_search_content', 'p');
return $output;
}
开发者ID:kkthemes,项目名称:fast-monkey-wordpress-theme,代码行数:7,代码来源:search.php
示例2: beans_embed_oembed
/**
* Add markup to embed.
*
* @since 1.0.0
*
* @param string $html The embed HTML.
*
* @return string The modified embed HTML.
*/
function beans_embed_oembed($html)
{
$output = beans_open_markup('beans_embed_oembed', 'div', 'class=tm-oembed');
$output .= $html;
$output .= beans_close_markup('beans_embed_oembed', 'div');
return $output;
}
开发者ID:KevinFairbanks,项目名称:Beans,代码行数:16,代码来源:embed.php
示例3: kkthemes_post_content
function kkthemes_post_content($content)
{
$output = beans_open_markup('kkthemes_post_content', 'p');
$output .= beans_output('kkthemes_post_content_summary', kkthemes_get_excerpt($content));
$output .= beans_close_markup('kkthemes_post_content', 'p');
$output .= '<p>' . beans_post_more_link() . '</p>';
return $output;
}
开发者ID:kkthemes,项目名称:kkthemes,代码行数:8,代码来源:post-views.php
示例4: beans_child_add_hero
function beans_child_add_hero()
{
echo beans_open_markup('beans_child_hero_section', 'div', array('class' => 'uk-block uk-block-large uk-container-center uk-text-center bc-block'));
$hero_content = '<h1 class="uk-heading-large">My Beans</h1>';
$hero_content .= '<p class="uk-article-lead">A demo theme for SitePoint</p>';
$hero_content .= '<p><a href="#" class="uk-button uk-button-large">Read Article <i class="uk-icon-external-link"></i></a></p>';
echo $hero_content;
echo beans_close_markup('beans_child_hero_section', 'div');
}
开发者ID:antonellaP,项目名称:Beans-Child-SitePoint-Demo,代码行数:9,代码来源:home.php
示例5: beans_search_form
/**
* Modify the search form.
*
* @since 1.0.0
*
* @return string The form.
*/
function beans_search_form()
{
$output = beans_open_markup('beans_search_form', 'form', array('class' => 'uk-form uk-form-icon uk-form-icon-flip uk-width-1-1', 'method' => 'get', 'action' => esc_url(home_url('/')), 'role' => 'search'));
$output .= beans_selfclose_markup('beans_search_form_input', 'input', array('class' => 'uk-width-1-1', 'type' => 'search', 'placeholder' => __('Search', 'beans'), 'value' => esc_attr(get_search_query()), 'name' => 's'));
$output .= beans_open_markup('beans_search_form_input_icon', 'i', 'class=uk-icon-search');
$output .= beans_close_markup('beans_search_form_input_icon', 'i');
$output .= beans_close_markup('beans_search_form', 'form');
return $output;
}
开发者ID:JoomPassion,项目名称:Beans,代码行数:16,代码来源:searchform.php
示例6: beans_footer_content
/**
* Echo the footer content.
*
* @since 1.0.0
*/
function beans_footer_content()
{
echo beans_open_markup('beans_footer_credit', 'div', array('class' => 'uk-clearfix uk-text-small uk-text-muted'));
echo beans_open_markup('beans_footer_credit_left', 'span', array('class' => 'uk-align-medium-left uk-margin-small-bottom'));
echo beans_output('beans_footer_credit_text', sprintf(__('© %1$s - %2$s. All rights reserved.', 'beans'), date("Y"), get_bloginfo('name')));
echo beans_close_markup('beans_footer_credit_left', 'span');
$framework_link = beans_open_markup('beans_footer_credit_framework_link', 'a', array('href' => esc_url('https://themebeans.com/beans'), 'rel' => 'designer'));
$framework_link .= beans_output('beans_footer_credit_framework_link_text', 'Beans');
$framework_link .= beans_close_markup('beans_footer_credit_framework_link', 'a');
echo beans_open_markup('beans_footer_credit_right', 'span', array('class' => 'uk-align-medium-right uk-margin-bottom-remove'));
echo beans_output('beans_footer_credit_right_text', sprintf(__('%1$s theme for WordPress.', 'beans'), $framework_link));
echo beans_close_markup('beans_footer_credit_right', 'span');
echo beans_close_markup('beans_footer_credit', 'div');
}
开发者ID:ThemeButler,项目名称:tm-demo,代码行数:19,代码来源:footer.php
示例7: kkthemes_site_title_tag
function kkthemes_site_title_tag()
{
// Stop here if there isn't a description.
if (!($description = get_bloginfo('description'))) {
return;
}
$tag_style = '';
$header_image = get_header_image();
if (!empty($header_image)) {
$tag_style = 'background-image: url(' . esc_url($header_image) . ');';
}
echo beans_open_markup('kkthemes_site_title_tag', 'div', array('class' => 'tm-site-title-tag tm-branded-panel uk-block uk-margin-large-bottom', 'itemprop' => 'description', 'style' => $tag_style));
echo beans_output('kkthemes_site_title_tag_text', $description);
echo beans_close_markup('kkthemes_site_title_tag', 'div');
}
开发者ID:kkthemes,项目名称:kkthemes,代码行数:15,代码来源:page_home.php
示例8: beans_field_description
/**
* Echo field description.
*
* @since 1.0.0
*
* @param array $field {
* Array of data.
*
* @type string $description The field description. The description can be truncated using <!--more-->
* as a delimiter. Default false.
* }
*/
function beans_field_description($field)
{
if (!($description = beans_get('description', $field))) {
return;
}
echo beans_open_markup('beans_field_description', 'div', array('class' => 'bs-field-description'));
if (preg_match('#<!--more-->#', $description, $matches)) {
list($description, $extended) = explode($matches[0], $description, 2);
}
echo $description;
if (isset($extended)) {
echo ' <a class="bs-read-more" href="#">' . __('More...', 'beans') . '</a>';
echo '<div class="bs-extended-content">' . $extended . '</div>';
}
echo beans_close_markup('beans_field_description', 'div');
}
开发者ID:ThemeButler,项目名称:tm-demo,代码行数:28,代码来源:field.php
示例9: beans_modify_menu_args
/**
* Modify wp_nav_menu arguments.
*
* This function converts the wp_nav_menu to UIKit format. It uses Beans custom walker and also makes
* use of the Beans HTML API.
*
* @since 1.0.0
*
* @param array $args The wp_nav_menu arguments.
*
* @return array The modified wp_nav_menu arguments.
*/
function beans_modify_menu_args($args)
{
// Get type.
$type = beans_get('beans_type', $args);
// Check if the menu is in a widget area and set the type accordingly if it is defined.
if ($widget_area_type = beans_get_widget_area('beans_type')) {
$type = $widget_area_type == 'stack' ? 'sidenav' : $widget_area_type;
}
// Stop if it isn't a beans menu.
if (!$type) {
return $args;
}
// Default item wrap attributes.
$attr = array('id' => '%1$s', 'class' => array(beans_get('menu_class', $args)));
// Add UIKit navbar item wrap attributes.
if ($type == 'navbar') {
$attr['class'][] = 'uk-navbar-nav';
}
// Add UIKit sidenav item wrap attributes.
if ($type == 'sidenav') {
$attr['class'][] = 'uk-nav uk-nav-parent-icon uk-nav-side';
$attr['data-uk-nav'] = '{multiple:true}';
}
// Add UIKit offcanvas item wrap attributes.
if ($type == 'offcanvas') {
$attr['class'][] = 'uk-nav uk-nav-parent-icon uk-nav-offcanvas';
$attr['data-uk-nav'] = '{multiple:true}';
}
// Implode to avoid empty spaces.
$attr['class'] = implode(' ', array_filter($attr['class']));
// Set to null if empty to avoid outputing empty class html attribute.
if (!$attr['class']) {
$attr['class'] = null;
}
$location_sub_filter = ($location = beans_get('theme_location', $args)) ? "[_{$location}]" : null;
// Force beans menu arguments.
$force = array('beans_type' => $type, 'items_wrap' => beans_open_markup("beans_menu[_{$type}]{$location_sub_filter}", 'ul', $attr, $args) . '%3$s' . beans_close_markup("beans_menu[_{$type}]{$location_sub_filter}", 'ul', $args));
// Allow walker overwrite.
if (!beans_get('walker', $args)) {
$args['walker'] = new _Beans_Walker_Nav_Menu();
}
// Adapt level to walker depth.
$force['beans_start_level'] = ($level = beans_get('beans_start_level', $args)) ? $level - 1 : 0;
return array_merge($args, $force);
}
开发者ID:ThemeButler,项目名称:tm-demo,代码行数:57,代码来源:menu.php
示例10: beans_post_meta_comments_shortcode
/**
* Echo post meta comments shortcode.
*
* @since 1.0.0
*/
function beans_post_meta_comments_shortcode()
{
global $post;
if (post_password_required() || !comments_open()) {
return;
}
$comments_number = (int) get_comments_number($post->ID);
if ($comments_number < 1) {
$comment_text = beans_output('beans_post_meta_empty_comment_text', __('Leave a comment', 'beans'));
} else {
if ($comments_number === 1) {
$comment_text = beans_output('beans_post_meta_comments_text_singular', __('1 comment', 'beans'));
} else {
$comment_text = beans_output('beans_post_meta_comments_text_plurial', __('%s comments', 'beans'));
}
}
echo beans_open_markup('beans_post_meta_comments', 'a', array('href' => esc_url(get_comments_link())));
printf($comment_text, (int) get_comments_number($post->ID));
echo beans_close_markup('beans_post_meta_comments', 'a');
}
开发者ID:ThemeButler,项目名称:tm-demo,代码行数:25,代码来源:post-shortcodes.php
示例11: beans_site_title_tag
/**
* Echo header site title tag.
*
* @since 1.0.0
*/
function beans_site_title_tag()
{
// Stop here if there isn't a description.
if (!($description = get_bloginfo('description'))) {
return;
}
echo beans_open_markup('beans_site_title_tag', 'span', array('class' => 'tm-site-title-tag uk-text-small uk-text-muted uk-display-block'));
echo beans_output('beans_site_title_tag_text', $description);
echo beans_close_markup('beans_site_title_tag', 'span');
}
开发者ID:ThemeButler,项目名称:tm-demo,代码行数:15,代码来源:header.php
示例12: beans_open_markup
echo beans_open_markup('woo_single_add_to_cart_variable_label_cell', 'td', array('class' => 'label'));
echo beans_open_markup('woo_single_add_to_cart_variable_label', 'label', array('for' => sanitize_title($attribute_name)));
echo wc_attribute_label($attribute_name);
echo beans_open_markup('woo_single_add_to_cart_variable_label', 'label');
echo beans_close_markup('woo_single_add_to_cart_variable_label_td', 'td');
echo beans_open_markup('woo_single_add_to_cart_variable_value_cell', 'td', array('class' => 'value'));
$selected = isset($_REQUEST['attribute_' . sanitize_title($attribute_name)]) ? wc_clean($_REQUEST['attribute_' . sanitize_title($attribute_name)]) : $product->get_variation_default_attribute($attribute_name);
wc_dropdown_variation_attribute_options(array('options' => $options, 'attribute' => $attribute_name, 'product' => $product, 'selected' => $selected));
echo end($attribute_keys) === $attribute_name ? beans_open_markup('woo_single_add_to_cart_remove_variation_link', 'a', array('class' => 'reset_variations', 'href' => '#')) . __('Clear selection', 'woocommerce') . beans_close_markup('woo_single_add_to_cart_remove_variation_link', 'a') : '';
echo beans_close_markup('woo_single_add_to_cart_variable_value_cell', 'td');
echo beans_close_markup('woo_single_add_to_cart_variable_tr', 'tr');
}
echo beans_close_markup('woo_single_add_to_cart_variable_tbody', 'tbody');
echo beans_close_markup('woo_single_add_to_cart_variable_table', 'table');
do_action('woocommerce_before_add_to_cart_button');
echo beans_open_markup('woo_single_add_to_cart_single_variation_wrap', 'div', array('class' => 'single_variation_wrap', 'style' => 'display:none;'));
/**
* woocommerce_before_single_variation Hook
*/
do_action('woocommerce_before_single_variation');
/**
* woocommerce_single_variation hook. Used to output the cart button and placeholder for variation data.
* @since 2.4.0
* @hooked woocommerce_single_variation - 10 Empty div for variation data.
* @hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
*/
do_action('woocommerce_single_variation');
/**
* woocommerce_after_single_variation Hook
*/
do_action('woocommerce_after_single_variation');
开发者ID:simondowdles,项目名称:woocommerce-overrides-for-beans,代码行数:31,代码来源:variable.php
示例13: beans_post_gallery
/**
* Modify WP {@link https://codex.wordpress.org/Function_Reference/gallery_shortcode Gallery Shortcode} output.
*
* This implements the functionality of the Gallery Shortcode for displaying WordPress images in a post.
*
* @since 1.3.0
*
* @param string $output The gallery output. Default empty.
* @param array $attr Attributes of the {@link https://codex.wordpress.org/Function_Reference/gallery_shortcode gallery_shortcode()}.
* @param int $instance Unique numeric ID of this gallery shortcode instance.
*
* @return string HTML content to display gallery.
*/
function beans_post_gallery($output, $attr, $instance)
{
$post = get_post();
$html5 = current_theme_supports('html5', 'gallery');
$defaults = array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post ? $post->ID : 0, 'itemtag' => $html5 ? 'figure' : 'dl', 'icontag' => $html5 ? 'div' : 'dt', 'captiontag' => $html5 ? 'figcaption' : 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '', 'link' => '');
$atts = shortcode_atts($defaults, $attr, 'gallery');
$id = intval($atts['id']);
// Set attachements.
if (!empty($atts['include'])) {
$_attachments = get_posts(array('include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby']));
$attachments = array();
foreach ($_attachments as $key => $val) {
$attachments[$val->ID] = $_attachments[$key];
}
} elseif (!empty($atts['exclude'])) {
$attachments = get_children(array('post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby']));
} else {
$attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby']));
}
// Stop here if no attachment.
if (empty($attachments)) {
return '';
}
if (is_feed()) {
$output = "\n";
foreach ($attachments as $att_id => $attachment) {
$output .= wp_get_attachment_link($att_id, $atts['size'], true) . "\n";
}
return $output;
}
// Valid tags.
$valid_tags = wp_kses_allowed_html('post');
$validate = array('itemtag', 'captiontag', 'icontag');
// Validate tags.
foreach ($validate as $tag) {
if (!isset($valid_tags[$atts[$tag]])) {
$atts[$tag] = $defaults[$tag];
}
}
// Set variables used in the output.
$columns = intval($atts['columns']);
$size_class = sanitize_html_class($atts['size']);
// WP adds the opening div in the gallery_style filter (weird), so we follow it as don't want to break people's site.
$gallery_div = beans_open_markup("beans_post_gallery[_{$id}]", 'div', array('class' => "uk-grid uk-grid-width-small-1-{$columns} gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}", 'data-uk-grid-margin' => false), $id, $columns);
/**
* Apply WP core filter. Filter the default gallery shortcode CSS styles.
*
* Documented in WordPress.
*
* @ignore
*/
$output = apply_filters('gallery_style', $gallery_div);
$i = 0;
foreach ($attachments as $attachment_id => $attachment) {
$attr = trim($attachment->post_excerpt) ? array('aria-describedby' => "gallery-{$instance}-{$id}") : '';
$image_meta = wp_get_attachment_metadata($attachment_id);
$orientation = '';
if (isset($image_meta['height'], $image_meta['width'])) {
$orientation = $image_meta['height'] > $image_meta['width'] ? 'portrait' : 'landscape';
}
// Set the image output.
if ('none' === $atts['link']) {
$image_output = wp_get_attachment_image($attachment_id, $atts['size'], false, $attr);
} else {
$image_output = wp_get_attachment_link($attachment_id, $atts['size'], 'file' !== $atts['link'], false, false, $attr);
}
$output .= beans_open_markup("beans_post_gallery_item[_{$attachment_id}]", $atts['itemtag'], array('class' => 'gallery-item'));
$output .= beans_open_markup("beans_post_gallery_icon[_{$attachment_id}]", $atts['icontag'], array('class' => "gallery-icon {$orientation}"));
// Automatically escaped.
$output .= beans_output("beans_post_gallery_icon[_{$attachment_id}]", $image_output, $attachment_id, $atts);
$output .= beans_close_markup("beans_post_gallery_icon[_{$attachment_id}]", $atts['icontag']);
if ($atts['captiontag'] && trim($attachment->post_excerpt)) {
$output .= beans_open_markup("beans_post_gallery_caption[_{$attachment_id}]", $atts['captiontag'], array('class' => 'wp-caption-text gallery-caption'));
$output .= beans_output("beans_post_gallery_caption_text[_{$attachment_id}]", wptexturize($attachment->post_excerpt));
$output .= beans_close_markup("beans_post_gallery_caption[_{$attachment_id}]", $atts['captiontag']);
}
$output .= beans_close_markup("beans_post_gallery_item[_{$attachment_id}]", $atts['itemtag']);
}
$output .= beans_close_markup("beans_post_gallery[_{$id}]", 'div');
return $output;
}
开发者ID:Getbeans,项目名称:Beans,代码行数:94,代码来源:post.php
示例14: apply_filters
* @version 2.4.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
/**
* Filter tabs and allow third parties to add their own
*
* Each tab is an array containing title, callback and priority.
* @see woocommerce_default_product_tabs()
*/
$tabs = apply_filters('woocommerce_product_tabs', array());
if (!empty($tabs)) {
echo beans_open_markup('woo_product_single_tabs_wrap', 'div', array('class' => 'woocommerce-tabs wc-tabs-wrapper'));
echo beans_open_markup('woo_product_single_tabs_wrap_list', 'ul', array('class' => 'tabs wc-tabs'));
foreach ($tabs as $key => $tab) {
echo beans_open_markup('woo_product_single_tabs_wrap_list_item', 'li', array('class' => esc_attr($key) . '_tab'));
echo beans_open_markup('woo_product_single_tabs_wrap_list_item_link', 'a', array('href' => '#tab-' . esc_attr($key)));
echo apply_filters('woocommerce_product_' . $key . '_tab_title', esc_html($tab['title']), $key);
echo beans_close_markup('woo_product_single_tabs_wrap_list_item_link', 'a');
echo beans_close_markup('woo_product_single_tabs_wrap_list_item', 'li');
}
echo beans_close_markup('woo_product_single_tabs_wrap_list', 'ul');
foreach ($tabs as $key => $tab) {
echo beans_open_markup('woo_product_single_tabs_wrap_tab', 'div', array('class' => 'panel entry-content wc-tab', 'id' => 'tab-' . esc_attr($key)));
call_user_func($tab['callback'], $key, $tab);
echo beans_close_markup('woo_product_single_tabs_wrap_tab', 'div');
}
echo beans_close_markup('woo_product_single_tabs_wrap', 'div');
}
开发者ID:simondowdles,项目名称:woocommerce-overrides-for-beans,代码行数:31,代码来源:tabs.php
示例15: beans_open_markup
/**
* Echo the structural markup that wraps around comments. It also calls the comments action hooks.
*
* This template will return empty if the post which is called is password protected.
*
* @package Structure\Comments
*/
// Stop here if the post is password protected.
if (post_password_required()) {
return;
}
echo beans_open_markup('beans_comments', 'div', array('id' => 'comments', 'class' => 'tm-comments' . (current_theme_supports('beans-default-styling') ? ' uk-panel-box' : null)));
if (comments_open(get_the_ID())) {
if (have_comments()) {
echo beans_open_markup('beans_comments_list', 'ol', array('class' => 'uk-comment-list'));
wp_list_comments(array('avatar_size' => 50, 'callback' => 'beans_comment_callback'));
echo beans_close_markup('beans_comments_list', 'ol');
} else {
/**
* Fires if no comments exist.
*
* This hook only fires if comments are open.
*
* @since 1.0.0
*/
do_action('beans_no_comment');
}
/**
* Fires after the comments list.
*
开发者ID:KevinFairbanks,项目名称:Beans,代码行数:30,代码来源:comments.php
示例16: start_el
/**
* Extend WordPress start menu elements.
*
* @ignore
*/
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
{
// Stop here if the depth is smaller than starting depth.
if ($depth < $args->beans_start_level) {
return;
}
$item_id = $item->ID;
// Wp item attributes.
$id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
$classes = empty($item->classes) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
$_classes = join(' ', (array) apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));
// WP link attributes.
$_link_attr = array('title' => $item->attr_title, 'target' => $item->target, 'rel' => $item->xfn, 'href' => $item->url);
// Prevent empty WP link attributes.
foreach ($_link_attr as $attr => $value) {
if (!empty($value)) {
$link_attr[$attr] = $value;
}
}
$link_attr = apply_filters('nav_menu_link_attributes', $link_attr, $item, $args);
// Set wp item attributes as defaults.
$item_attr = array('class' => array($_classes));
// Add UIKit active class.
if (in_array('current-menu-item', $classes)) {
$item_attr['class'][] = 'uk-active';
}
// Add UIKit parent attributes.
if ($depth == $args->beans_start_level && in_array('menu-item-has-children', $classes)) {
$item_attr['class'][] = 'uk-parent';
if (beans_get('beans_type', $args) == 'navbar') {
$item_attr['data-uk-dropdown'] = '';
$child_indicator = true;
}
}
// Implode to avoid empty spaces.
$item_attr['class'] = implode(' ', array_filter($item_attr['class']));
// Set to null if empty to avoid outputing empty class html attribute.
if (!$item_attr['class']) {
$item_attr['class'] = null;
}
$output .= beans_open_markup("beans_menu_item[_{$item_id}]", 'li', $item_attr, $item, $depth, $args);
$item_output = $args->before;
$item_output .= beans_open_markup("beans_menu_item_link[_{$item_id}]", 'a', $link_attr, $item, $depth, $args);
$item_output .= beans_output("beans_menu_item_text[_{$item_id}]", $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after);
if (isset($child_indicator)) {
$item_output .= beans_open_markup("beans_menu_item_child_indicator[_{$item_id}]", 'i', array('class' => 'uk-icon-caret-down uk-margin-small-left'), $item, $depth, $args);
$item_output .= beans_close_markup("beans_menu_item_child_indicator[_{$item_id}]", 'i', $item, $depth, $args);
}
$item_output .= beans_close_markup("beans_menu_item_link[_{$item_id}]", 'a', $link_attr, $item, $depth, $args);
$item_output .= $args->after;
$output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
}
开发者ID:ThemeButler,项目名称:tm-demo,代码行数:58,代码来源:walker.php
示例17: beans_open_markup
<?php
/**
* Single Product Price, including microdata for SEO
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $product;
echo beans_open_markup('woo_single_price_wrap', 'div', array('itemprop' => 'offers', 'itemscope' => '', 'itemtype' => 'http://schema.org/Offer'));
echo beans_open_markup('woo_single_price_p', 'p', array('class' => 'price'));
echo $product->get_price_html();
echo beans_close_markup('woo_single_price_p', 'p');
echo beans_selfclose_markup('woo_single_price_meta_price', 'meta', array('itemprop' => 'price', 'content' => esc_attr($product->get_price())));
echo beans_selfclose_markup('woo_single_price_meta_currency', 'meta', array('itemprop' => 'priceCurrency', 'content' => esc_attr(get_woocommerce_currency())));
echo beans_selfclose_markup('woo_single_price_meta_link', 'link', array('itemprop' => 'availability', 'href' => 'http://schema.org/' . $product->is_in_stock() ? 'InStock' : 'OutOfStock'));
echo beans_close_markup('woo_single_price_wrap', 'div');
开发者ID:simondowdles,项目名称:woocommerce-overrides-for-beans,代码行数:22,代码来源:price.php
示例18: empty
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $product;
if (!$product->is_purchasable()) {
return;
}
// Availability
$availability = $product->get_availability();
$availability_html = empty($availability['availability']) ? '' : beans_open_markup('woo_single_add_to_cart_grouped_availability', 'p', array('class' => 'stock')) . esc_attr($availability['class']) . '">' . esc_html($availability['availability']) . beans_close_markup('woo_single_add_to_cart_grouped_availability', 'p');
echo apply_filters('woocommerce_stock_html', $availability_html, $availability['availability'], $product);
if ($product->is_in_stock()) {
do_action('woocommerce_before_add_to_cart_form');
echo beans_open_markup('woo_single_add_to_cart_simple_form', 'form', array('class' => 'cart', 'method' => 'post', 'enctype' => 'multipart/form-data'));
do_action('woocommerce_before_add_to_cart_button');
if (!$product->is_sold_individually()) {
woocommerce_quantity_input(array('min_value' => apply_filters('woocommerce_quantity_input_min', 1, $product), 'max_value' => apply_filters('woocommerce_quantity_input_max', $product->backorders_allowed() ? '' : $product->get_stock_quantity(), $product), 'input_value' => isset($_POST['quantity']) ? wc_stock_amount($_POST['quantity']) : 1));
}
echo beans_selfclose_markup('woo_single_add_to_cart_simple_input_hidden', 'input', array('type' => 'hidden', 'name' => 'add-to-cart', 'value' => esc_attr($product->id)));
echo beans_open_markup('woo_single_add_to_cart_simple_submit_button', 'button', array('type' => 'submit', 'class' => 'single_add_to_cart_button button alt'));
echo esc_html($product->single_add_to_cart_text());
echo beans_close_markup('woo_single_add_to_cart_grouped_tbody_submit_button', 'button');
do_action('woocommerce_after_add_to_cart_button');
echo beans_close_markup('woo_single_add_to_cart_simple_form', 'form');
do_action('woocommerce_after_add_to_cart_form');
}
开发者ID:simondowdles,项目名称:woocommerce-overrides-for-beans,代码行数:31,代码来源:simple.php
示例19: beans_post_password_form
/**
* Modify password protected form.
*
* @since 1.0.0
*
* @return string The form.
*/
function beans_post_password_form()
{
global $post;
$label = 'pwbox-' . (empty($post->ID) ? rand() : $post->ID);
// Notice.
$output = beans_open_markup('beans_password_form_notice', 'p', array('class' => 'uk-alert uk-alert-warning'));
$output .= beans_output('beans_password_form_notice_text', __('This post is protected. To view it, enter the password below!', 'beans'));
$output .= beans_close_markup('beans_password_form_notice', 'p');
// Form.
$output .= beans_open_markup('beans_password_form', 'form', array('class' => 'uk-form uk-margin-bottom', 'method' => 'post', 'action' => esc_url(site_url('wp-login.php?action=postpass', 'login_post'))));
$output .= beans_selfclose_markup('beans_password_form_input', 'input', array('class' => 'uk-margin-small-top uk-margin-small-right', 'type' => 'password', 'placeholder' => esc_attr(apply_filters('beans_password_form_input_placeholder', __('Password', 'beans'))), 'name' => 'post_password'));
$output .= beans_selfclose_markup('beans_password_form_submit', 'input', array('class' => 'uk-button uk-margin-small-top', 'type' => 'submit', 'name' => 'submit', 'value' => esc_attr(apply_filters('beans_password_form_submit_text', __('Submit', 'beans')))));
$output .= beans_close_markup('beans_password_form', 'form');
return $output;
}
开发者ID:ThemeButler,项目名称:tm-demo,代码行数:22,代码来源:post.php
示例20: beans_no_menu_notice
/**
* Echo no menu notice.
*
* @since 1.0.0
*/
function beans_no_menu_notice()
{
echo beans_open_markup('beans_no_menu_notice', 'p', array('class' => 'uk-alert uk-alert-warning'));
echo beans_output('beans_no_menu_notice_text', __('Whoops, your site does not have a menu!', 'beans'));
echo beans_close_markup('beans_no_menu_notice', 'p');
}
开发者ID:JoomPassion,项目名称:Beans,代码行数:11,代码来源:menu.php
注:本文中的beans_open_markup函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论