当前位置: 首页>>代码示例>>PHP>>正文


PHP TimberHelper::get_comment_form方法代码示例

本文整理汇总了PHP中TimberHelper::get_comment_form方法的典型用法代码示例。如果您正苦于以下问题:PHP TimberHelper::get_comment_form方法的具体用法?PHP TimberHelper::get_comment_form怎么用?PHP TimberHelper::get_comment_form使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimberHelper的用法示例。


在下文中一共展示了TimberHelper::get_comment_form方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCommentForm

 function testCommentForm()
 {
     $post_id = $this->factory->post->create();
     $form = TimberHelper::get_comment_form($post_id);
     $form = trim($form);
     $this->assertStringStartsWith('<div id="respond"', $form);
 }
开发者ID:ruscon,项目名称:timber,代码行数:7,代码来源:test-timber-helper.php

示例2: get_context

 /**
  * Custom implementation for get_context method.
  */
 public function get_context()
 {
     global $content_width;
     if (class_exists('Easy_Digital_Downloads')) {
         global $edd_options;
     }
     $context = Timber::get_context();
     $sidebar_primary = Timber::get_widgets('sidebar_primary');
     $sidebar_footer = Timber::get_widgets('sidebar_footer');
     $context['theme_mods'] = get_theme_mods();
     $context['site_options'] = wp_load_alloptions();
     $context['teaser_mode'] = apply_filters('maera/teaser/mode', 'excerpt');
     $context['thumbnail']['width'] = apply_filters('maera/image/width', 600);
     $context['thumbnail']['height'] = apply_filters('maera/image/height', 371);
     $context['menu']['primary'] = has_nav_menu('primary_navigation') ? new TimberMenu('primary_navigation') : null;
     $context['sidebar']['primary'] = apply_filters('maera/sidebar/primary', $sidebar_primary);
     $context['sidebar']['footer'] = apply_filters('maera/sidebar/footer', $sidebar_footer);
     $context['pagination'] = Timber::get_pagination();
     $context['comment_form'] = TimberHelper::get_comment_form();
     $context['comments_args'] = array('style' => 'ul', 'reply_text' => __('Reply', 'maera'), 'short_ping' => true, 'avatar_size' => 60);
     $context['site_logo'] = get_option('site_logo', false);
     $context['content_width'] = $content_width;
     $context['sidebar_template'] = maera_templates_sidebar();
     if (class_exists('Easy_Digital_Downloads')) {
         $data['edd_options'] = $edd_options;
         $data['download_categories'] = Timber::get_terms('download_category');
         $data['download_tags'] = Timber::get_terms('download_tag');
         $data['default_image'] = new TimberImage(get_template_directory_uri() . '/assets/images/default.png');
     }
     return apply_filters('maera/timber/context', $context);
 }
开发者ID:wpmu,项目名称:maera,代码行数:34,代码来源:class-maera-timber.php

示例3: timber_extras

 /**
  * Timber extras.
  */
 function timber_extras($data)
 {
     // get secondary sidebar
     $sidebar_secondary = Timber::get_widgets('sidebar_secondary');
     $data['sidebar']['secondary'] = apply_filters('maera/sidebar/secondary', $sidebar_secondary);
     $extra_widget_areas = Maera_BS_Widgets::extra_widget_areas_array();
     foreach ($extra_widget_areas as $extra_widget_area => $options) {
         if (0 != get_theme_mod($extra_widget_area . '_toggle', 0)) {
             $data['sidebar'][$extra_widget_area] = Timber::get_widgets($extra_widget_area);
         }
     }
     $comment_form_args = array('comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x('Comment', 'noun', 'maera_bs') . '</label><textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', 'id_submit' => 'comment-submit');
     $data['content_width'] = Maera_BS_Structure::content_width_px();
     $data['post_meta'] = Maera_BS_Meta::meta_elements();
     $data['comment_form'] = TimberHelper::get_comment_form(null, $comment_form_args);
     return $data;
 }
开发者ID:sevir,项目名称:maera-bootstrap,代码行数:20,代码来源:class-maera-bs-timber.php

示例4: TrunckPost

<?php

/**
 * The Template for displaying all single posts
 *
 * Methods for TimberHelper can be found in the /lib sub-directory
 *
 * @package  WordPress
 * @subpackage  Timber
 * @since    Timber 0.1
 */
$context = Timber::get_context();
$post = new TrunckPost();
$context['post'] = $post;
$context['comment_form'] = TimberHelper::get_comment_form();
if (post_password_required($post->ID)) {
    Timber::render('single-password.twig', $context);
} else {
    Timber::render(array('single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig'), $context);
}
开发者ID:gholme4,项目名称:trunck_theme,代码行数:20,代码来源:single.php

示例5:

<?php

/**
 * @package  WordPress
 * @subpackage  Preach
 * @since   Preach 1.1.0
 */
$data = Timber::get_context();
$post = Timber::query_post();
$data['post'] = $post;
$data['comment_form'] = TimberHelper::get_comment_form();
if (post_password_required($post->ID)) {
    Timber::render('single-password.twig', $data);
} else {
    Timber::render(array('single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig'), $data);
}
开发者ID:awdebruijn,项目名称:Preach-Framework,代码行数:16,代码来源:single.php

示例6: add_to_context

 public function add_to_context($context)
 {
     $context['regions'] = $this->get_theme_regions();
     $context['menu'] = new TimberMenu();
     $context['site'] = $this;
     $context['pagination'] = Timber::get_pagination();
     $context['comment_form'] = TimberHelper::get_comment_form();
     return $context;
 }
开发者ID:oligoform,项目名称:timber-regions,代码行数:9,代码来源:site.php

示例7: array

<?php

$args = array('comment_field' => '<div class="comment-form__comment"><label for="comment">' . _x('Comment', 'noun') . '</label> <textarea id="comment" name="comment" cols="45" rows="4"  aria-required="true" required="required"></textarea></div>', 'must_log_in' => '<div class="comment-form__log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url(apply_filters('the_permalink', get_permalink()))) . '</div>', 'logged_in_as' => '<div class="comment-form__logged-in">' . sprintf(__('<a href="%1$s" aria-label="Logged in as %2$s. Edit your profile.">Logged in as %2$s</a>. <a href="%3$s">Log out?</a>'), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</div>', 'comment_notes_before' => '<div class="comment-form__notes"><span id="email-notes">' . __('Your email address will not be published.') . '</span> </div>', 'comment_notes_after' => '', 'class_form' => 'comment-form', 'class_submit' => 'comment-form__submit', 'title_reply' => '', 'title_reply_to' => __('Leave a Reply to %s'), 'title_reply_before' => '', 'title_reply_after' => '', 'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />', 'submit_field' => '<div class="comment-form__submit-wrapper">%1$s %2$s</div>', 'format' => 'html5');
$context['comment_form'] = TimberHelper::get_comment_form(null, $args);
开发者ID:ambercouch,项目名称:ac_timber,代码行数:4,代码来源:timber--comment-form.php


注:本文中的TimberHelper::get_comment_form方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。