本文整理汇总了PHP中beans_output函数的典型用法代码示例。如果您正苦于以下问题:PHP beans_output函数的具体用法?PHP beans_output怎么用?PHP beans_output使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了beans_output函数的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_post_meta_categories_shortcode
/**
* Echo post meta categories shortcode.
*
* @since 1.0.0
*/
function beans_post_meta_categories_shortcode()
{
$categories = get_the_category_list(', ');
if (!$categories || is_wp_error($categories)) {
return;
}
echo beans_output('beans_post_meta_categories_prefix', __('Filed under: ', 'beans')) . $categories;
}
示例3: beans_post_meta_categories_shortcode
/**
* Echo post meta categories shortcode.
*
* @since 1.0.0
*/
function beans_post_meta_categories_shortcode()
{
$categories = get_the_category_list(', ');
if (!$categories || is_wp_error($categories)) {
return;
}
printf('%1$s%2$s', beans_output('beans_post_meta_categories_prefix', __('Filed under: ', 'tm-beans')), $categories);
}
示例4: 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;
}
示例5: kkthemes_placeholder_img
function kkthemes_placeholder_img()
{
$image = '<span class="tm-placeholder-img uk-float-left uk-margin-right"><i class="uk-icon-circle-thin uk-icon-large"></i></span>';
$name = beans_output('beans_site_title_text', get_bloginfo('name'));
if ($logo = get_theme_mod('beans_logo_image', false)) {
$image = beans_selfclose_markup('beans_post_logo_image', 'img', array('class' => 'tm-post-widget-img uk-border-rounded uk-float-left', 'src' => esc_url($logo), 'alt' => esc_attr($name)));
}
return $image;
}
示例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_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');
}
示例9: totem_comment_title_prefix
function totem_comment_title_prefix()
{
echo beans_open_markup('totem_comment_title_extra', 'span', array('class' => 'uk-margin-small-left'));
echo beans_output('totem_comment_title_extra', __('says:', 'tm-totem'));
echo beans_close_markup('totem_comment_title_extra', 'span');
}
示例10: 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;
}
示例11: beans_comment_form_fields
/**
* Modify comment form fields.
*
* This function replaces the default WordPress comment fields.
*
* @since 1.0.0
*
* @param array $fields The WordPress default fields.
*
* @return array The modified fields.
*/
function beans_comment_form_fields($fields)
{
$commenter = wp_get_current_commenter();
// Author.
$author = beans_open_markup('beans_comment_form[_name]', 'div', array('class' => 'uk-width-medium-1-3'));
/**
* Filter whether the comment form name legend should load or not.
*
* @since 1.0.0
*/
if (beans_apply_filters('beans_comment_form_legend[_name]', true)) {
$author .= beans_open_markup('beans_comment_form_legend[_name]', 'legend');
$author .= beans_output('beans_comment_form_legend_text[_name]', __('Name', 'tm-beans'));
$author .= beans_close_markup('beans_comment_form_legend[_name]', 'legend');
}
$author .= beans_selfclose_markup('beans_comment_form_field[_name]', 'input', array('id' => 'author', 'class' => 'uk-width-1-1', 'type' => 'text', 'value' => esc_attr($commenter['comment_author']), 'name' => 'author'));
$author .= beans_close_markup('beans_comment_form[_name]', 'div');
// Email.
$email = beans_open_markup('beans_comment_form[_email]', 'div', array('class' => 'uk-width-medium-1-3'));
/**
* Filter whether the comment form email legend should load or not.
*
* @since 1.0.0
*/
if (beans_apply_filters('beans_comment_form_legend[_email]', true)) {
$email .= beans_open_markup('beans_comment_form_legend[_email]', 'legend');
$email .= beans_output('beans_comment_form_legend_text[_email]', sprintf(__('Email %s', 'tm-beans'), get_option('require_name_email') ? ' *' : ''));
$email .= beans_close_markup('beans_comment_form_legend[_email]', 'legend');
}
$email .= beans_selfclose_markup('beans_comment_form_field[_email]', 'input', array('id' => 'email', 'class' => 'uk-width-1-1', 'type' => 'text', 'value' => esc_attr($commenter['comment_author_email']), 'name' => 'email', 'required' => get_option('require_name_email') ? '' : null));
$email .= beans_close_markup('beans_comment_form[_email]', 'div');
// Url.
$url = beans_open_markup('beans_comment_form[_website]', 'div', array('class' => 'uk-width-medium-1-3'));
/**
* Filter whether the comment form url legend should load or not.
*
* @since 1.0.0
*/
if (beans_apply_filters('beans_comment_form_legend[_url]', true)) {
$url .= beans_open_markup('beans_comment_form_legend', 'legend');
$url .= beans_output('beans_comment_form_legend_text[_url]', __('Website', 'tm-beans'));
$url .= beans_close_markup('beans_comment_form_legend[_url]', 'legend');
}
$url .= beans_selfclose_markup('beans_comment_form_field[_url]', 'input', array('id' => 'url', 'class' => 'uk-width-1-1', 'type' => 'text', 'value' => esc_attr($commenter['comment_author_url']), 'name' => 'url'));
$url .= beans_close_markup('beans_comment_form[_website]', 'div');
$fields = array('author' => $author, 'email' => $email, 'url' => $url);
return $fields;
}
示例12: beans_output
<?php
/**
* Despite its name, this template echos between the opening HTML markup and the opening primary markup.
*
* This template must be called using get_header().
*
* @package Beans\Structure\Header
*/
echo beans_output('beans_doctype', '<!DOCTYPE html>');
echo beans_open_markup('beans_html', 'html', str_replace(' ', '&', str_replace('"', '', beans_render_function('language_attributes'))));
echo beans_open_markup('beans_head', 'head');
/**
* Fires in the head.
*
* This hook fires in the head HTML section, not in wp_header().
*
* @since 1.0.0
*/
do_action('beans_head');
// Keep if for plugins.
wp_head();
echo beans_close_markup('beans_head', 'head');
echo beans_open_markup('beans_body', 'body', array('class' => implode(' ', get_body_class('uk-form no-js'))));
echo beans_open_markup('beans_site', 'div', array('class' => 'tm-site'));
echo beans_open_markup('beans_header', 'header', array('class' => 'tm-header uk-block', 'role' => 'banner'));
echo beans_open_markup('beans_fixed_wrap[_header]', 'div', 'class=uk-container uk-container-center');
/**
* Fires in the header.
*
* @since 1.0.0
示例13: 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');
}
示例14: 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;
}
示例15: bench_404_post_content
function bench_404_post_content()
{
return beans_output('bench_no_post_article_content_text', __('Page not found', 'bench'));
}