本文整理汇总了PHP中tc__f函数的典型用法代码示例。如果您正苦于以下问题:PHP tc__f函数的具体用法?PHP tc__f怎么用?PHP tc__f使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tc__f函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tc_post_content
/**
* The default template for displaying single post content
*
* @package Customizr
* @since Customizr 3.0
*/
function tc_post_content()
{
//check conditional tags : we want to show single post or single custom post types
global $post;
$tc_show_single_post_content = isset($post) && 'page' != $post->post_type && 'attachment' != $post->post_type && is_singular() && !tc__f('__is_home_empty');
if (!apply_filters('tc_show_single_post_content', $tc_show_single_post_content)) {
return;
}
//display an icon for div if there is no title
$icon_class = in_array(get_post_format(), array('quote', 'aside', 'status', 'link')) ? apply_filters('tc_post_format_icon', 'format-icon') : '';
ob_start();
do_action('__before_content');
?>
<section class="entry-content <?php
echo $icon_class;
?>
">
<?php
the_content(__('Continue reading <span class="meta-nav">→</span>', 'customizr'));
?>
<?php
wp_link_pages(array('before' => '<div class="pagination pagination-centered">' . __('Pages:', 'customizr'), 'after' => '</div>'));
?>
</section><!-- .entry-content -->
<?php
do_action('__after_content');
$html = ob_get_contents();
if ($html) {
ob_end_clean();
}
echo apply_filters('tc_post_content', $html);
}
示例2: tc_single_post_thumbnail_view
/**
* Single post thumbnail view
*
* @package Customizr
* @since Customizr 3.2.0
*/
function tc_single_post_thumbnail_view()
{
$_exploded_location = explode('|', esc_attr(tc__f('__get_option', 'tc_single_post_thumb_location')));
$_hook = isset($_exploded_location[0]) ? $_exploded_location[0] : '__before_content';
$_size_to_request = '__before_main_wrapper' == $_hook ? 'slider-full' : 'slider';
//get the thumbnail data (src, width, height) if any
$thumb_data = TC_post_thumbnails::$instance->tc_get_thumbnail_data($_size_to_request);
$_single_thumbnail_wrap_class = implode(" ", apply_filters('tc_single_post_thumb_class', array('row-fluid', 'tc-single-post-thumbnail-wrapper', current_filter())));
ob_start();
?>
<div class="<?php
echo $_single_thumbnail_wrap_class;
?>
">
<?php
TC_post_thumbnails::$instance->tc_display_post_thumbnail($thumb_data, 'span12');
?>
</div>
<?php
$html = ob_get_contents();
if ($html) {
ob_end_clean();
}
echo apply_filters('tc_single_post_thumbnail_view', $html);
}
示例3: tc_get_breadcrumb
/**
*
* @package Customizr
* @since Customizr 1.0
*/
function tc_get_breadcrumb()
{
$__options = tc__f('__options');
//get the default layout
$tc_breadcrumb = $__options['tc_breadcrumb'];
if ($tc_breadcrumb != 1) {
return;
}
$args = array('container' => 'div', 'separator' => '»', 'before' => false, 'after' => false, 'front_page' => true, 'show_home' => __('Home', 'customizr'), 'network' => false, 'echo' => true);
//do not display breadcrumb on home page
if (is_home() || is_front_page()) {
return;
}
?>
<div class="tc-hot-crumble container" role="navigation">
<div class="row">
<div class="span12">
<?php
$this->tc_breadcrumb_trail($args);
?>
</div>
</div>
</div>
<?php
}
示例4: tc_page_content
/**
* The template part for displaying page content
*
* @package Customizr
* @since Customizr 3.0
*/
function tc_page_content() {
if ( 'page' != tc__f('__post_type') || ! is_singular() || tc__f( '__is_home_empty') )
return;
ob_start();
do_action( '__before_content' );
?>
<div class="entry-content">
<?php
the_content( __( 'Continue reading <span class="meta-nav">→</span>' , 'customizr' ) );
wp_link_pages( array(
'before' => '<div class="btn-toolbar page-links"><div class="btn-group">' . __( 'Pages:' , 'customizr' ),
'after' => '</div></div>',
'link_before' => '<button class="btn btn-small">',
'link_after' => '</button>',
'separator' => '',
)
);
?>
</div>
<?php
do_action( '__after_content' );
$html = ob_get_contents();
if ($html) ob_end_clean();
echo apply_filters( 'tc_page_content', $html );
}
示例5: tc_breadcrumb_display
/**
*
* @package Customizr
* @since Customizr 1.0
*/
function tc_breadcrumb_display()
{
if (!apply_filters('tc_show_breadcrumb', 1 == tc__f('__get_option', 'tc_breadcrumb') && !tc__f('__is_home'))) {
return;
}
$args = array('container' => 'div', 'separator' => '»', 'before' => false, 'after' => false, 'front_page' => true, 'show_home' => __('Home', 'customizr'), 'network' => false, 'echo' => true);
echo apply_filters('tc_breadcrumb_display', sprintf('<div class="tc-hot-crumble container" role="navigation"><div class="row"><div class="%1$s">%2$s</div></div></div>', apply_filters('tc_breadcrumb_class', 'span12'), $this->tc_breadcrumb_trail($args)));
}
示例6: tc_customizer_styles
/**
* Registers and enqueues Customizr stylesheets
* @package Customizr
* @since Customizr 1.1
*/
function tc_customizer_styles()
{
wp_register_style('customizr-skin', TC_BASE_URL . 'inc/css/' . tc__f('__get_option', 'tc_skin'), array(), CUSTOMIZR_VER, $media = 'all');
//enqueue skin
wp_enqueue_style('customizr-skin');
//enqueue WP style sheet
wp_enqueue_style('customizr-style', get_stylesheet_uri(), array('customizr-skin'), CUSTOMIZR_VER, $media = 'all');
}
示例7: tc_breadcrumb_display
/**
*
* @package Customizr
* @since Customizr 1.0
*/
function tc_breadcrumb_display()
{
if (!apply_filters('tc_show_breadcrumb', 1 == tc__f('__get_option', 'tc_breadcrumb') && !tc__f('__is_home'))) {
return;
}
//set the args properties
$this->args = $this->_get_args();
echo apply_filters('tc_breadcrumb_display', sprintf('<div class="tc-hot-crumble container" role="navigation"><div class="row"><div class="%1$s">%2$s</div></div></div>', apply_filters('tc_breadcrumb_class', 'span12'), $this->tc_breadcrumb_trail($this->args)));
}
示例8: tc_comments
/**
* Main commments template
*
* @package Customizr
* @since Customizr 3.0.10
*/
function tc_comments()
{
//By default not displayed on home, for protected posts, and if no comments for page option is checked
$comments_bool = post_password_required() || tc__f('__is_home') || is_page() && 1 != esc_attr(tc__f('__get_option', 'tc_page_comments')) ? false : true;
if (!apply_filters('tc_show_comments', $comments_bool)) {
return;
}
comments_template('', true);
}
示例9: tc_maybe_add_gfonts_to_editor
function tc_maybe_add_gfonts_to_editor()
{
$_font_pair = esc_attr(tc__f('__get_option', 'tc_fonts'));
$_all_font_pairs = TC_init::$instance->font_pairs;
if (false === strpos($_font_pair, '_g_')) {
return;
}
//Commas in a URL need to be encoded before the string can be passed to add_editor_style.
return array(str_replace(',', '%2C', sprintf('//fonts.googleapis.com/css?family=%s', TC_utils::$instance->tc_get_font('single', $_font_pair))));
}
示例10: tc_slider_choices
/**
* retrieve slider names and generate the select list
* @package Customizr
* @since Customizr 3.0.1
*/
function tc_slider_choices()
{
$slider_names = tc__f('__get_option', 'tc_sliders');
$slider_choices = array(0 => __('— No slider —', 'customizr'), 'demo' => __('— Demo Slider —', 'customizr'));
if ($slider_names) {
foreach ($slider_names as $tc_name => $slides) {
$slider_choices[$tc_name] = $tc_name;
}
}
return $slider_choices;
}
示例11: tc_fp_block_display
/**
* The template displaying the front page featured page block.
*
*
* @package Customizr
* @since Customizr 3.0
*/
function tc_fp_block_display()
{
//gets display options
$tc_show_featured_pages = esc_attr(TC_utils::$inst->tc_opt('tc_show_featured_pages'));
$tc_show_featured_pages_img = esc_attr(TC_utils::$inst->tc_opt('tc_show_featured_pages_img'));
if (!apply_filters('tc_show_fp', 0 != $tc_show_featured_pages && tc__f('__is_home'))) {
return;
}
//gets the featured pages array and sets the fp layout
$fp_ids = apply_filters('tc_featured_pages_ids', TC_init::$instance->fp_ids);
$fp_nb = count($fp_ids);
$fp_per_row = apply_filters('tc_fp_per_line', 3);
//defines the span class
$span_array = array(1 => 12, 2 => 6, 3 => 4, 4 => 3, 5 => 2, 6 => 2, 7 => 2);
$span_value = 4;
$span_value = $fp_per_row > 7 ? 1 : $span_value;
$span_value = isset($span_array[$fp_per_row]) ? $span_array[$fp_per_row] : $span_value;
//save $args for filter
$args = array($fp_ids, $fp_nb, $fp_per_row, $span_value);
?>
<?php
ob_start();
?>
<div class="container marketing">
<?php
do_action('__before_fp');
$j = 1;
for ($i = 1; $i <= $fp_nb; $i++) {
printf('%1$s<div class="span%2$s fp-%3$s">%4$s</div>%5$s', 1 == $j ? sprintf('<div class="%1$s" role="complementary">', implode(" ", apply_filters('tc_fp_widget_area', array('row', 'widget-area')))) : '', $span_value, $fp_ids[$i - 1], $this->tc_fp_single_display($fp_ids[$i - 1], $tc_show_featured_pages_img), $j == $fp_per_row || $i == $fp_nb ? '</div>' : '');
//set $j back to start value if reach $fp_per_row
$j++;
$j = $j == $fp_per_row + 1 ? 1 : $j;
}
do_action('__after_fp');
?>
</div><!-- .container -->
<?php
echo !tc__f('__is_home_empty') ? apply_filters('tc_after_fp_separator', '<hr class="featurette-divider ' . current_filter() . '">') : '';
?>
<?php
$html = ob_get_contents();
if ($html) {
ob_end_clean();
}
echo apply_filters('tc_fp_block_display', $html, $args);
}
示例12: my_credits_display
function my_credits_display($html)
{
$logo_src = esc_url(tc__f('__get_option', 'tc_logo_upload'));
if (empty($logo_src)) {
return $html;
}
?>
<div class="span4 credits">
<?php
$credits = sprintf('<br/><p> © <a href="%2$s">%3$s</a> %1$s <a href="mailto:%4$s" title="%2$s" >%4$s</a> </p> ', esc_attr(date('Y')), esc_url(home_url()), esc_attr(get_bloginfo()), 'info@storybooksound.com');
echo $credits . "</div>";
}
示例13: tc_post_metas
/**
* The template part for displaying entry metas
*
* @package Customizr
* @since Customizr 1.0
*/
function tc_post_metas()
{
global $post;
//when do we display the metas ?
//1) we don't show metas on home page, 404, search page by default
//2) +filter conditions
$post_metas_bool = tc__f('__is_home') || is_404() || 'page' == $post->post_type ? false : true;
$post_metas_bool = apply_filters('tc_show_post_metas', $post_metas_bool);
if (!$post_metas_bool) {
return;
}
ob_start();
?>
<div class="entry-meta">
<?php
if ('attachment' == $post->post_type) {
$metadata = wp_get_attachment_metadata();
printf('%1$s <span class="entry-date"><time class="entry-date updated" datetime="%2$s">%3$s</time></span> %4$s %5$s', '<span class="meta-prep meta-prep-entry-date">' . __('Published', 'customizr') . '</span>', esc_attr(get_the_date('c')), esc_html(get_the_date()), isset($metadata['width']) && isset($metadata['height']) ? __('at dimensions', 'customizr') . '<a href="' . esc_url(wp_get_attachment_url()) . '" title="' . __('Link to full-size image', 'customizr') . '"> ' . $metadata['width'] . ' × ' . $metadata['height'] . '</a>' : '', __('in', 'customizr') . '<a href="' . esc_url(get_permalink($post->post_parent)) . '" title="' . __('Return to ', 'customizr') . esc_attr(strip_tags(get_the_title($post->post_parent))) . '" rel="gallery"> ' . get_the_title($post->post_parent) . '</a>.');
} else {
$categories_list = $this->tc_category_list();
$tag_list = $this->tc_tag_list();
$date = apply_filters('tc_date_meta', sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date updated" datetime="%3$s">%4$s</time></a>', esc_url(get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d'))), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())));
//end filter
$author = apply_filters('tc_author_meta', sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'customizr'), get_the_author())), get_the_author()));
//end filter
// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
if ($tag_list) {
$utility_text = __('This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
} elseif ($categories_list) {
$utility_text = __('This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
} else {
$utility_text = __('This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'customizr');
}
$utility_text = apply_filters('tc_meta_utility_text', $utility_text);
//echoes every metas components
printf($utility_text, $categories_list, $tag_list, $date, $author);
}
//endif attachment
?>
</div><!-- .entry-meta -->
<?php
$html = ob_get_contents();
if ($html) {
ob_end_clean();
}
echo apply_filters('tc_post_metas', $html);
}
示例14: tc_breadcrumb_display
/**
*
* @package Customizr
* @since Customizr 1.0
*/
function tc_breadcrumb_display()
{
if (!apply_filters('tc_show_breadcrumb', 1 == esc_attr(TC_utils::$inst->tc_opt('tc_breadcrumb')))) {
return;
}
if (!apply_filters('tc_show_breadcrumb_in_context', true)) {
return;
}
if (tc__f('__is_home') && 1 != esc_attr(TC_utils::$inst->tc_opt('tc_show_breadcrumb_home'))) {
return;
}
//set the args properties
$this->args = $this->_get_args();
echo apply_filters('tc_breadcrumb_display', sprintf('<div class="tc-hot-crumble container" role="navigation"><div class="row"><div class="%1$s">%2$s</div></div></div>', apply_filters('tc_breadcrumb_class', 'span12'), $this->tc_breadcrumb_trail($this->args)));
}
示例15: tc_set_archives_heading_hooks
/**
* @return void
* set up hooks for archives headings
* hook : template_redirect
*
* @package Customizr
* @since Customizr 3.2.6
*/
function tc_set_archives_heading_hooks() {
//is there anything to render in the current context
//by default don't display the Customizr title in feeds
if ( apply_filters('tc_display_customizr_headings', ! $this -> tc_archive_title_and_class_callback() || is_feed() ) )
return;
//Headings for archives, authors, search, 404
add_action ( '__before_loop' , array( $this , 'tc_render_headings_view' ) );
//Set archive icon with customizer options (since 3.2.0)
add_filter ( 'tc_archive_icon' , array( $this , 'tc_set_archive_icon' ) );
add_filter( 'tc_archive_header_class' , array( $this , 'tc_archive_title_and_class_callback'), 10, 2 );
add_filter( 'tc_headings_archive_html' , array( $this , 'tc_archive_title_and_class_callback'), 10, 1 );
global $wp_query;
if ( tc__f('__is_home') || $wp_query -> is_posts_page )
add_filter( 'tc_archive_headings_separator' , '__return_false' );
}