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; }
/** * 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; }
/** * 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); }
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; }
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; }
/** * 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'); }
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'); }
/** * 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'); }
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'); }
/** * 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; }
/** * 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; }
<?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
/** * 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'); }
/** * 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; }
function bench_404_post_content() { return beans_output('bench_no_post_article_content_text', __('Page not found', 'bench')); }
function kkthemes_site_title() { echo beans_output('beans_site_title_text', get_bloginfo('name')); }
/** * Send report. */ public function report() { // Send report. $send = wp_mail('*****@*****.**', 'Compiler error', 'Compiler error reported by ' . home_url(), array('MIME-Version: 1.0' . "\r\n", 'Content-type: text/html; charset=utf-8' . "\r\n", "X-Mailer: PHP \r\n", 'From: ' . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . ' < ' . get_option('admin_email') . '>' . "\r\n", 'Reply-To: ' . get_option('admin_email') . "\r\n")); // Die and display message. wp_die(beans_output('beans_compiler_report_error_text', sprintf('<p>%s<p>', __('Thanks for your contribution by reporting this issue. We hope to hear from you again.', 'tm-beans')))); }
/** * Echo comment textarea field. * * This function replaces the default WordPress comment textarea field. * * @since 1.0.0 */ function beans_comment_form_comment() { echo beans_open_markup('beans_comment_form[_comment]', 'p', array('class' => 'uk-width-medium-1-1')); /** * Filter whether the comment form textarea legend should load or not. * * @since 1.0.0 */ if (beans_apply_filters('beans_comment_form_legend[_comment]', true)) { echo beans_open_markup('beans_comment_form_legend[_comment]', 'legend'); echo beans_output('beans_comment_form_legend_text[_comment]', __('Comment *', 'tm-beans')); echo beans_close_markup('beans_comment_form_legend[_comment]', 'legend'); } echo beans_open_markup('beans_comment_form_field[_comment]', 'textarea', array('id' => 'comment', 'class' => 'uk-width-1-1', 'name' => 'comment', 'required' => '', 'rows' => 8)); echo beans_close_markup('beans_comment_form_field[_comment]', 'textarea'); echo beans_close_markup('beans_comment_form[_comment]', 'p'); }
function bench_footer_content() { ?> <div class="uk-grid uk-text-muted"> <div class="uk-width-medium-1-3"> <?php echo '<div class="tm-footer-logo">'; if ($logo = get_theme_mod('beans_logo_image', false)) { echo beans_open_markup('beans_site_title_link', 'a', array('href' => esc_url(home_url()), 'rel' => 'home', 'itemprop' => 'headline')); echo beans_selfclose_markup('beans_logo_image', 'img', array('class' => 'tm-logo', 'src' => esc_url($logo), 'alt' => esc_attr(get_bloginfo('name')))); echo beans_close_markup('beans_site_title_link', 'a'); } echo '</div>'; if ($description = get_bloginfo('description')) { echo '<p class="uk-margin-small-top uk-margin-bottom">' . $description . '</p>'; } wp_nav_menu(array('theme_location' => 'social-menu', 'container' => 'div', 'container_class' => 'tm-social-menu', 'menu_class' => '', 'fallback_cb' => 'false')); ?> <div class="uk-text-muted uk-text-small uk-margin-large-top"> <?php echo '<div>'; echo beans_output('beans_footer_credit_text', sprintf(__('© %1$s - %2$s. All rights reserved.', 'bench'), date("Y"), get_bloginfo('name'))); echo '</div>'; ?> <a href="https://kkthemes.com/wordpress/bench/" target="_blank" title="Bench theme for WordPress">Bench</a> theme for <a href="http://wordpress.org" target="_blank">WordPress</a>. Built-with <a href="http://www.getbeans.io/" title="Beans Framework for WordPress" target="_blank">Beans</a>. </div> </div> <div class="uk-width-medium-2-3"> <?php bench_bottom_widget_area(); ?> </div> </div> <?php bench_site_toolbar(); }
function fast_monkey_site_title() { echo beans_output('beans_site_title_text', get_bloginfo('name')); }
function banks_404_post_content() { return beans_output('banks_no_post_article_content_text', __('Page not found', 'tbr-banks')); }
/** * 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); }
/** * 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); }