本文整理汇总了PHP中beans_add_smart_action函数的典型用法代码示例。如果您正苦于以下问题:PHP beans_add_smart_action函数的具体用法?PHP beans_add_smart_action怎么用?PHP beans_add_smart_action使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了beans_add_smart_action函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: kkthemes_homepage_setup_document
function kkthemes_homepage_setup_document()
{
beans_add_smart_action('beans_header_after_markup', 'kkthemes_site_title_tag');
beans_add_smart_action('beans_content_after_markup', 'kkthemes_homepage_contents');
kkthemes_post_view(true);
//change this to manually output post loop when more post types are there.
beans_add_filter('beans_loop_query_args[_main]', 'kkthemes_theme_home_query_args');
//remove pagination
beans_remove_action('beans_posts_pagination');
}
示例2: kkthemes_post_view
function kkthemes_post_view($featured_items = false)
{
// Posts grid
beans_add_attribute('beans_post', 'class', 'tm-post-grid uk-grid uk-grid-medium');
beans_add_attribute('beans_post_image', 'class', 'uk-width-medium-1-2');
beans_wrap_markup('beans_post_header', 'kkthemes_post_preview', 'div', array('class' => 'tm-post-preview uk-width-medium-1-2'));
if (is_featured_item() || $featured_items) {
//More button
beans_add_attribute('beans_post_more_link', 'class', 'uk-button uk-button-large uk-margin-top');
} else {
// Post title
beans_add_attribute('beans_post_title', 'class', 'uk-h2');
}
// Post content
beans_remove_action('beans_post_content');
beans_remove_markup('beans_post_body');
add_action('kkthemes_post_preview_append_markup', 'the_content');
// Auto generate summary of Post content and read more button
beans_add_smart_action('the_content', 'kkthemes_post_content');
// Post meta
beans_remove_action('beans_post_meta_tags');
beans_remove_action('beans_post_meta_categories');
// Post image
beans_modify_action('beans_post_image', 'beans_post_header_before_markup', 'beans_post_image');
}
示例3: flipster_setup_document
function flipster_setup_document()
{
// Header and Primary Menu
beans_remove_attribute('beans_site_branding', 'class', 'uk-float-left');
beans_remove_attribute('beans_primary_menu', 'class', 'uk-float-right');
// Layout
if (beans_get_layout() != 'c') {
beans_remove_attribute('beans_primary', 'class', 'uk-width-medium-7-10');
beans_add_attribute('beans_primary', 'class', 'uk-width-large-7-10');
beans_remove_attribute('beans_sidebar_primary', 'class', 'uk-width-medium-3-10');
beans_add_attribute('beans_sidebar_primary', 'class', 'uk-width-large-3-10 uk-visible-large');
}
// Breadcrumb
if (!is_archive()) {
beans_remove_action('beans_breadcrumb');
}
// Navigation
beans_add_attribute('beans_sub_menu_wrap', 'class', 'uk-dropdown-center');
beans_remove_attribute('beans_menu_item_child_indicator', 'class', 'uk-margin-small-left');
// Post content
beans_add_attribute('beans_post_content', 'class', 'uk-text-large');
// Post meta
beans_remove_action('beans_post_meta_categories');
beans_remove_output('beans_post_meta_categories_prefix');
beans_remove_output('beans_post_meta_date_prefix');
beans_add_attribute('beans_post_meta_date', 'class', 'uk-text-muted');
// Post embed
beans_add_attribute('beans_embed_oembed', 'class', 'tm-cover-article');
// Comment form
beans_add_attribute('beans_comment_form_wrap', 'class', 'tm-cover-article');
beans_add_attribute('beans_comment_fields_inner_wrap', 'class', 'uk-grid-small');
beans_add_attribute('beans_comment_form_submit', 'class', 'uk-button-large');
if (!is_user_logged_in()) {
beans_replace_attribute('beans_comment_form_comment', 'class', 'uk-width-medium-1-1', 'uk-width-medium-6-10');
} else {
//Add edit post link when user is logged in
if (is_singular()) {
beans_add_smart_action('beans_post_header_before_markup', 'flipster_edit_link');
}
}
// Only applies to singular and not pages
if (is_singular() && !is_page()) {
//remove featured image
beans_remove_action('beans_post_image');
// Post title
beans_add_attribute('beans_post_title', 'class', 'uk-margin-bottom');
//Widget area after post content
beans_add_smart_action('the_content', 'flipster_widget_after_post_content');
// Post author profile
add_action('beans_comments_before_markup', 'flipster_author_profile');
}
// Search
if (is_search()) {
beans_remove_action('beans_post_image');
}
}
示例4: kkthemes_index_setup_document
function kkthemes_index_setup_document()
{
if (is_main_archive()) {
// Remove breadcrumb if this is main archive (accessible from main menu)
// Other archives like Tags archive, author archive, month archive etc will continue to have breadcumb
beans_remove_action('beans_breadcrumb');
//Add a large Title panel in these archive pages
beans_add_smart_action('beans_header_after_markup', 'kkthemes_archive_title');
}
kkthemes_post_view();
// Posts pagination
beans_modify_action_hook('beans_posts_pagination', 'beans_content_after_markup');
}
示例5: kkthemes_page_setup_document
function kkthemes_page_setup_document()
{
//Remove breadcrumb
beans_remove_action('beans_breadcrumb');
//Remove padding from main wrapper
beans_remove_attribute('beans_main', 'class', 'uk-block');
beans_remove_attribute('beans_post', 'class', 'uk-article');
//Remove container so we can have full width Page title
beans_remove_attribute('beans_fixed_wrap[_main]', 'class', 'uk-container');
beans_remove_attribute('beans_fixed_wrap[_main]', 'class', '-center');
$tag_style = '';
$header_image = get_header_image();
if (!empty($header_image)) {
$tag_style = 'background-image: url(' . esc_url($header_image) . ');';
}
//Add styling to Page header
beans_wrap_inner_markup('beans_post_header', 'kk_themes_page_header', 'div', array('class' => 'uk-panel uk-panel-box uk-panel-space uk-text-large uk-text-center uk-margin-large-bottom tm-branded-panel', 'style' => $tag_style));
// Display any Post excerpts below Page title.
beans_add_smart_action('beans_post_header_append_markup', the_excerpt);
//Center page content and add a large bottom margin since we removed uk-block earlier from beans_main
beans_add_attribute('beans_post_body', 'class', 'uk-container uk-container-center tm-maxwidth-content uk-margin-large-bottom');
}
示例6: kkthemes_setup_document
function kkthemes_setup_document()
{
beans_remove_action('beans_header_image');
//remove default header image
// Move breadcrumb just below header
beans_modify_action_hook('beans_breadcrumb', 'beans_header_after_markup');
beans_add_attribute('beans_breadcrumb', 'class', 'uk-container uk-container-center uk-hidden-small');
// Site Logo
beans_remove_action('beans_site_title_tag');
//Add back site title after logo image
//beans_add_smart_action('beans_logo_image_after_markup', 'kkthemes_site_title');
if (is_user_logged_in()) {
//Add edit post link when user is logged in
if (is_singular() && !is_page_template('page_home.php')) {
beans_add_smart_action('beans_post_header_prepend_markup', 'kkthemes_edit_link');
}
}
//content
beans_remove_attribute('beans_post', 'class', 'uk-panel-box');
//comments
beans_remove_attribute('beans_comments', 'class', 'uk-panel-box');
}
示例7: beans_modify_markup
beans_modify_markup('beans_post_title', 'h2');
beans_add_attribute('beans_post_title', 'class', 'uk-h2');
beans_add_attribute('beans_post', 'class', 'uk-grid-margin');
// Post image
beans_remove_action('beans_post_image');
// Post meta
beans_remove_action('beans_post_meta');
beans_remove_action('beans_post_meta_tags');
beans_remove_action('beans_post_meta_categories');
// Remove article search
beans_remove_output('beans_no_post_search_form');
}
// Add the search form
beans_add_smart_action('beans_search_title_after_markup', 'fast_monkey_search_field');
function fast_monkey_search_field($content)
{
echo beans_open_markup('fast_monkey_search_content', 'div', array('class' => 'uk-grid-margin'));
get_search_form();
echo beans_close_markup('fast_monkey_search_content', 'div');
}
// Clean up the search results item markup
beans_add_smart_action('the_content', '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;
}
// Load beans document.
beans_load_document();
示例8: beans_enqueue_uikit_components
* Beans style is enqueued with the UIKit components to have access to UIKit LESS variables.
*
* @since 1.0.0
*/
function beans_enqueue_uikit_components()
{
$core = array('base', 'block', 'grid', 'article', 'comment', 'panel', 'nav', 'navbar', 'subnav', 'table', 'breadcrumb', 'pagination', 'list', 'form', 'button', 'badge', 'alert', 'dropdown', 'offcanvas', 'text', 'utility', 'icon');
beans_uikit_enqueue_components($core);
// Include uikit default theme.
beans_uikit_enqueue_theme('default');
// Enqueue uikit overwrite theme folder.
beans_uikit_enqueue_theme('beans', BEANS_ASSETS_URL . 'less/uikit-overwrite');
// Add the theme style as a uikit fragment to have access to all the variables.
beans_compiler_add_fragment('uikit', BEANS_ASSETS_URL . 'less/style.less', 'less');
// Add the theme default style as a uikit fragment only if the theme supports it.
if (current_theme_supports('beans-default-styling')) {
beans_compiler_add_fragment('uikit', BEANS_ASSETS_URL . 'less/default.less', 'less');
}
}
beans_add_smart_action('wp_enqueue_scripts', 'beans_enqueue_assets', 5);
/**
* Enqueue Beans assets.
*
* @since 1.0.0
*/
function beans_enqueue_assets()
{
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
示例9: elseif
// Replace content with excerpt and more link if not singular.
elseif ( is_home() )
return '<p>' . get_the_excerpt() . '</p><p class="uk-margin-bottom-remove">'. beans_post_more_link() . '</p>';
}
// Register the help menu
register_nav_menus( array(
'help' => 'Help Menu'
) );
// Register bottom widget area
beans_add_smart_action( 'widgets_init', 'banks_register_bottom_widget_area' );
function banks_register_bottom_widget_area() {
beans_register_widget_area( array(
'name' => 'Footer',
'id' => 'footer',
'description' => 'Widgets in this area will be shown in the footer section as a grid.',
'beans_type' => 'grid'
) );
}
// Add footer content
beans_modify_action_callback( 'beans_footer_content', 'tbr_footer' );
示例10: beans_add_smart_action
<?php
/* Helpers and utility functions */
require_once 'include/helpers.php';
beans_add_smart_action('beans_before_load_document', 'kkthemes_single_setup_document');
function kkthemes_single_setup_document()
{
beans_remove_action('beans_breadcrumb');
//remove featured image
beans_remove_action('beans_post_image');
//Center page content and add a large bottom margin since we removed uk-block earlier from beans_main
beans_add_attribute('beans_main', 'class', 'tm-maxwidth-content');
}
// Load beans document
beans_load_document();
示例11: beans_close_markup
echo beans_close_markup('jenkins_post_meta_item_comments_icon', 'i');
}
// Remove comment after note (filter)
beans_add_smart_action('comment_form_defaults', 'jenkins_comment_form_defaults');
function jenkins_comment_form_defaults($args)
{
$args['comment_notes_after'] = '';
return $args;
}
// Add avatar uikit circle class (filter)
beans_add_smart_action('get_avatar', 'jenkins_avatar');
function jenkins_avatar($output)
{
return str_replace("class='avatar", "class='avatar uk-border-circle", $output);
}
// Modify the tags cloud widget
beans_add_smart_action('wp_generate_tag_cloud', 'jenkins_widget_tags_cloud');
function jenkins_widget_tags_cloud($output)
{
return preg_replace("#style='font-size:.+pt;'#", '', $output);
}
// Add footer content (filter)
beans_add_smart_action('beans_footer_credit_right_text_output', 'jenkins_footer');
function jenkins_footer()
{
?>
<a href="http://www.themebutler.com/themes/jenkins/" target="_blank" title="Jenkins theme for WordPress">Jenkins</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>.
<?php
}
示例12: beans_add_smart_action
<?php
/**
* @package API\Fields\Types
*/
beans_add_smart_action('beans_field_enqueue_scripts_slider', 'beans_field_slider_assets');
/**
* Enqueued assets required by the beans slider field.
*
* @since 1.0.0
*/
function beans_field_slider_assets()
{
wp_enqueue_script('jquery-ui-slider');
}
beans_add_smart_action('beans_field_slider', 'beans_field_slider');
/**
* Echo slider field type.
*
* @since 1.0.0
*
* @param array $field {
* For best practices, pass the array of data obtained using {@see beans_get_fields()}.
*
* @type mixed $value The field value.
* @type string $name The field name value.
* @type array $attributes An array of attributes to add to the field. The array key defines the
* attribute name and the array value defines the attribute value. Default array.
* @type mixed $default The default value. Default false.
* @type string $min The slider minimum value. Default 0.
* @type string $max The slider maximum value. Default 100.
示例13: beans_output
echo beans_output('beans_widget_title_text', $title);
echo beans_close_markup('beans_widget_title' . _beans_widget_subfilters(), 'h3');
}
beans_add_smart_action('beans_widget', 'beans_widget_content', 15);
/**
* Echo widget content.
*
* @since 1.0.0
*/
function beans_widget_content()
{
echo beans_open_markup('beans_widget_content' . _beans_widget_subfilters(), 'div');
echo beans_output('beans_widget_content' . _beans_widget_subfilters(), beans_get_widget('content'));
echo beans_close_markup('beans_widget_content' . _beans_widget_subfilters(), 'div');
}
beans_add_smart_action('beans_no_widget', 'beans_no_widget');
/**
* Echo no widget content.
*
* @since 1.0.0
*/
function beans_no_widget()
{
// Only apply this notice to sidebar_primary and sidebar_secondary.
if (!in_array(beans_get_widget_area('id'), array('sidebar_primary', 'sidebar_secondary'))) {
return;
}
echo beans_open_markup('beans_no_widget_notice', 'p', array('class' => 'uk-alert uk-alert-warning'));
echo beans_output('beans_no_widget_notice_text', sprintf(__('%s does not have any widget assigned!', 'tm-beans'), beans_get_widget_area('name')));
echo beans_close_markup('beans_no_widget_notice', 'p');
}
示例14: beans_add_smart_action
<?php
/**
* @package Beans\API\Fields\Types
*/
beans_add_smart_action('beans_field_select', 'beans_field_select');
/**
* Echo select field type.
*
* @since 1.0.0
*
* @param array $field {
* For best practices, pass the array of data obtained using {@see beans_get_fields()}.
*
* @type mixed $value The field value.
* @type string $name The field name value.
* @type array $attributes An array of attributes to add to the field. The array key defines the
* attribute name and the array value defines the attribute value. Default array.
* @type mixed $default The default value. Default false.
* @type array $options An array used to populate the select options. The array key defines option
* value and the array value defines the option label.
* }
*/
function beans_field_select($field)
{
if (empty($field['options'])) {
return;
}
echo '<select name="' . $field['name'] . '" ' . beans_sanatize_attributes($field['attributes']) . '>';
foreach ($field['options'] as $value => $label) {
$selected = $value == $field['value'] ? ' selected="selected"' : null;
示例15: beans_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');
}
beans_add_smart_action('wp_footer', 'beans_replace_nojs_class');
/**
* Print inline JavaScript in the footer to replace the 'no-js' class with 'js'.
*
* @since 1.0.0
*/
function beans_replace_nojs_class()
{
?>
<script type="text/javascript">
(function() {
document.body.className = document.body.className.replace('no-js','js');
}());
</script><?php
}