本文整理汇总了PHP中beans_close_markup函数的典型用法代码示例。如果您正苦于以下问题:PHP beans_close_markup函数的具体用法?PHP beans_close_markup怎么用?PHP beans_close_markup使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了beans_close_markup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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');
}
示例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;
}
示例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');
}
示例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');
}
示例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');
}
示例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);
}
示例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');
}
示例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');
}
示例12: isset
$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');
echo beans_close_markup('woo_single_add_to_cart_single_variation_wrap', 'div');
do_action('woocommerce_after_add_to_cart_button');
}
do_action('woocommerce_after_variations_form');
echo beans_close_markup('woo_single_add_to_cart_variable_form', 'form');
do_action('woocommerce_after_add_to_cart_form');
示例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;
}
示例14: beans_modify_widget_count
/**
* Modify widget count.
*
* @since 1.0.0
*
* @param string $content The widget content.
*
* @return string The modified widget content.
*/
function beans_modify_widget_count($content)
{
$count = beans_output('beans_widget_count', '$1');
if (beans_get('dropdown', beans_get_widget('options')) == true) {
$output = $count;
} else {
$output = beans_open_markup('beans_widget_count', 'span', 'class=tm-count');
$output .= $count;
$output .= beans_close_markup('beans_widget_count', 'span');
}
// Keep closing tag to avoid overwriting the inline JavaScript.
return preg_replace('#>((\\s| )\\((.*)\\))#', '>' . $output, $content);
}
示例15: beans_open_markup
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.
*
* This hook only fires if comments are open.
*
* @since 1.0.0
*/
do_action('beans_after_open_comments');
} else {
/**
* Fires if comments are closed.
*
* @since 1.0.0
*/
do_action('beans_comments_closed');
}
echo beans_close_markup('beans_comments', 'div');