%2$s
%3$s' , '' ); ?>
%2$s
%3$s' , '' ); ?>
' . __( 'Edit' , 'customizr' ) . '
' : '' ), sprintf( '' , esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s' , 'customizr' ), get_comment_date(), get_comment_time() ) ) ), ( '0' == $comment->comment_approved ) ? sprintf('%1$s
', __( 'Your comment is awaiting moderation.' , 'customizr' ) ) : '', sprintf('%2$s
', $fp_single_id, $text ); echo apply_filters( 'tc_fp_text_block' , $tc_fp_text_block , $fp_single_id , $text, $featured_page_id); //button block $tc_fp_button_text = apply_filters( 'tc_fp_button_text' , esc_attr( czr_fn_opt( 'tc_featured_page_button_text') ) , $fp_single_id ); if ( $tc_fp_button_text || czr_fn_is_customizing() ){ $tc_fp_button_class = apply_filters( 'tc_fp_button_class' , 'btn btn-primary fp-button', $fp_single_id ); $tc_fp_button_class = $tc_fp_button_text ? $tc_fp_button_class : $tc_fp_button_class . ' hidden'; $tc_fp_button_block = sprintf('%3$s', $tc_fp_button_class, $featured_page_link, $tc_fp_button_text ); echo apply_filters( 'tc_fp_button_block' , $tc_fp_button_block , $featured_page_link , $featured_page_title , $fp_single_id, $featured_page_id ); } ?> czr_fn_get_thumbnail_model( $fp_img_size, $featured_page_id, $fp_custom_img_id ); //finally we define a default holder if no thumbnail found or page is protected if ( isset( $_fp_img_model["tc_thumb"]) && ! empty( $_fp_img_model["tc_thumb"] ) && ! post_password_required( $featured_page_id ) ) $fp_img = $_fp_img_model["tc_thumb"]; else $fp_img = false; return $fp_img; } function czr_fn_show_featured_pages() { //gets display fp option $tc_show_featured_pages = esc_attr( czr_fn_opt( 'tc_show_featured_pages' ) ); return apply_filters( 'tc_show_fp', 0 != $tc_show_featured_pages && czr_fn__f('__is_home') ); } function czr_fn_show_featured_pages_img() { //gets display img option return apply_filters( 'tc_show_featured_pages_img', esc_attr( czr_fn_opt( 'tc_show_featured_pages_img' ) ) ); } }//end of class endif; ?> czr_fn_is_gallery_enabled() && apply_filters( 'tc_gallery_style', esc_attr( czr_fn_opt( 'tc_gallery_style' ) ) ) ) array_push($_classes, 'tc-gallery-style'); return $_classes; } /** * Add an optional rel="tc-fancybox[]" attribute to all images embedded in a post gallery * Based on the original WP function * @package Customizr * @since Customizr 3.0.5 * */ function czr_fn_modify_attachment_link( $markup, $id, $size, $permalink, $icon, $text ) { if ( ! $this -> czr_fn_is_gallery_enabled() ) return $markup; $tc_gallery_fancybox = apply_filters( 'tc_gallery_fancybox', esc_attr( czr_fn_opt( 'tc_gallery_fancybox' ) ) , $id ); if ( $tc_gallery_fancybox == 1 && $permalink == false ) //add the filter only if link to the attachment file/image { $id = intval( $id ); $_post = get_post( $id ); if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) ) return __( 'Missing Attachment' , 'customizr'); if ( $permalink ) $url = get_attachment_link( $_post->ID ); $post_title = esc_attr( $_post->post_title ); if ( $text ) $link_text = $text; elseif ( $size && 'none' != $size ) $link_text = wp_get_attachment_image( $id, $size, $icon ); else $link_text = ''; if ( trim( $link_text ) == '' ) $link_text = $_post->post_title; $markup = ''.$link_text.''; } return $markup; } /* * HELPERS */ function czr_fn_is_gallery_enabled(){ return apply_filters('tc_enable_gallery', esc_attr( czr_fn_opt('tc_enable_gallery') ) ); } }//end of class endif; ?> czr_fn_archive_title_and_class_callback() || is_feed() ) ) return; //Headings for archives, authors, search, 404 add_action ( '__before_loop' , array( $this , 'czr_fn_render_headings_view' ) ); //Set archive icon with customizer options (since 3.2.0) add_filter ( 'tc_archive_icon' , array( $this , 'czr_fn_set_archive_icon' ) ); add_filter( 'tc_archive_header_class' , array( $this , 'czr_fn_archive_title_and_class_callback'), 10, 2 ); add_filter( 'tc_headings_archive_html' , array( $this , 'czr_fn_archive_title_and_class_callback'), 10, 1 ); global $wp_query; if ( czr_fn__f('__is_home') ) add_filter( 'tc_archive_headings_separator' , '__return_false' ); } /** * @return void * set up hooks for post and page headings * callback of template_redirect * * @package Customizr * @since Customizr 3.2.6 */ function czr_fn_set_post_page_heading_hooks() { //by default don't display the Customizr title of the front page and in feeds if ( apply_filters('tc_display_customizr_headings', ( is_front_page() && 'page' == get_option( 'show_on_front' ) ) ) || is_feed() ) return; //Set single post/page icon with customizer options (since 3.2.0) add_filter ( 'tc_content_title_icon' , array( $this , 'czr_fn_set_post_page_icon' ) ); //Prepare the headings for post, page, attachment add_action ( '__before_content' , array( $this , 'czr_fn_render_headings_view' ) ); //Populate heading with default content add_filter ( 'tc_headings_content_html' , array( $this , 'czr_fn_post_page_title_callback'), 10 ); //Create the Customizr title add_filter( 'tc_the_title' , array( $this , 'czr_fn_content_heading_title' ) , 0 ); //Add edit link add_filter( 'tc_the_title' , array( $this , 'czr_fn_add_edit_link_after_title' ), 2 ); //Set user defined archive titles add_filter( 'tc_category_archive_title' , array( $this , 'czr_fn_set_archive_custom_title' ) ); add_filter( 'tc_tag_archive_title' , array( $this , 'czr_fn_set_archive_custom_title' ) ); add_filter( 'tc_search_results_title' , array( $this , 'czr_fn_set_archive_custom_title' ) ); add_filter( 'tc_author_archive_title' , array( $this , 'czr_fn_set_archive_custom_title' ) ); //SOME DEFAULT OPTIONS //No hr if not singular if ( ! is_singular() ) add_filter( 'tc_content_headings_separator' , '__return_false' ); //No headings for some post formats add_filter( 'tc_headings_content_html' , array( $this, 'czr_fn_post_formats_heading') , 100 ); } /****************************************** * VIEWS *********************************** ******************************************/ /** * Generic heading view : archives, author, search, 404 and the post page heading (if not font page) * This is the place where every heading content blocks are hooked * hook : __before_content AND __before_loop (for post lists) * * @package Customizr * @since Customizr 3.1.0 */ function czr_fn_render_headings_view() { $_heading_type = in_the_loop() ? 'content' : 'archive'; ob_start(); ?>%2$s
%3$s%3$s
', implode( ' ', apply_filters( 'tc_slide_text_class', array( 'lead' ), $data['text'], $slider_name_id ) ), $data['color_style'], $data['text'] ) : '', //button call to action ( apply_filters( 'tc_slide_show_button', $data['button_text'] != null, $slider_name_id ) ) ? sprintf('%4$s', implode( ' ', apply_filters( 'tc_slide_button_class', array( 'btn', 'btn-large', 'btn-primary' ), $data['button_text'], $slider_name_id ) ), $button_link, $data['link_target'], $data['button_text'] ) : '' ); } /** * Slide edit link subview * @param $_view_model = array( $id, $data , $slider_name_id, $img_size ) * * @package Customizr * @since Customizr 3.3+ * */ function czr_fn_render_slide_edit_link_view( $_view_model ) { //never display when customizing if ( czr_fn_is_customizing() ) return; //extract $_view_model = array( $id, $data , $slider_name_id, $img_size ) extract( $_view_model ); //display edit link for logged in users with edit_post capabilities //upload_files cap isn't a good lower limit 'cause for example and Author can upload_files but actually cannot edit medias he/she hasn't uploaded $show_slide_edit_link = ( is_user_logged_in() && current_user_can( 'edit_post', $id ) ) ? true : false; $show_slide_edit_link = apply_filters('tc_show_slide_edit_link' , $show_slide_edit_link && ! is_null($data['link_id']), $id ); if ( ! $show_slide_edit_link ) return; $_edit_link_suffix = 'tc_posts_slider' == $slider_name_id ? '' : '#slider_sectionid'; //in case of tc_posts_slider the $id is the *post* id, otherwise it's the attachment id $_edit_link = get_edit_post_link($id) . $_edit_link_suffix; printf('%2$s', $_edit_link, __( 'Edit' , 'customizr' ) ); } /** * Slider Edit deeplink * @param $slides, array of slides * @param $slider_name_id string, the name of the current slider * * hook : __after_carousel_inner * @since v3.4.9 */ function czr_fn_render_slider_edit_link_view( $slides, $slider_name_id ) { //never display when customizing if ( czr_fn_is_customizing() ) return; if ( 'demo' == $slider_name_id ) return; $show_slider_edit_link = false; //We have to show the slider edit link to //a) users who can edit theme options for the slider in home -> deep link in the customizer //b) users who can edit the post/page where the slider is displayed for users who can edit the post/page -> deep link in the post/page slider section if ( czr_fn__f('__is_home') ){ $show_slider_edit_link = ( is_user_logged_in() && current_user_can('edit_theme_options') ) ? true : false; $_edit_link = czr_fn_get_customizer_url( array( 'control' => 'tc_front_slider', 'section' => 'frontpage_sec') ); }else if ( is_singular() ){ // we have a snippet to display sliders in categories, we don't want the slider edit link displayed there global $post; $show_slider_edit_link = ( is_user_logged_in() && ( current_user_can('edit_pages') || current_user_can( 'edit_posts', $post -> ID ) ) ) ? true : false; $_edit_link = get_edit_post_link( $post -> ID ) . '#slider_sectionid'; } $show_slider_edit_link = apply_filters( 'tc_show_slider_edit_link' , $show_slider_edit_link, $slider_name_id ); if ( ! $show_slider_edit_link ) return; // The posts slider shows a different text $_text = sprintf( __( 'Customize or remove %s' , 'customizr' ), ( 'tc_posts_slider' == $slider_name_id ) ?__('the posts slider', 'customizr') : __('this slider', 'customizr' ) ); printf('%2$s', $_edit_link, $_text ); } /* * Slider controls view * @param slides * @hook : __after_carousel_inner * @since v3.2.0 * */ function czr_fn_slider_control_view( $_slides ) { if ( count( $_slides ) <= 1 ) return; if ( ! apply_filters('tc_show_slider_controls' , ! wp_is_mobile() ) ) return; $_html = ''; $_html .= sprintf('%1$s %2$s %3$s
', apply_filters( 'tc_copyright_link', sprintf( '· © %1$s %3$s', esc_attr( date( 'Y' ) ), esc_url( home_url() ), esc_attr( get_bloginfo() ) ) ), apply_filters( 'tc_wp_powered', sprintf( '· %1$s ·', __('Powered by', 'customizr'), __('Powered by WordPress', 'customizr') ) ), apply_filters( 'tc_credit_link', sprintf( '%1$s ·', sprintf( __('Designed with the %s', 'customizr'), sprintf( '%2$s', esc_url( CZR_WEBSITE . 'customizr' ), __('Customizr theme', 'customizr') ) ) ) ) ) ) ); } /** * Displays the back to top fixed text block in the colophon * * * @package Customizr * @since Customizr 3.0.10 */ function czr_fn_colophon_right_block() { //since 3.4.16 BTT button excludes BTT text if ( ! apply_filters('tc_show_text_btt', 0 == esc_attr( czr_fn_opt( 'tc_show_back_to_top' ) ) ) ) return; echo apply_filters( 'tc_colophon_right_block', sprintf('', implode( ' ', apply_filters( 'tc_colophon_right_block_class', array( 'span3', 'backtop' ) ) ), __( 'Back to top' , 'customizr' ), is_rtl() ? 'pull-left' : 'pull-right' ) ); } /****************************** * CALLBACKS / SETTERS *******************************/ /** * Set priorities for right and left colophon blocks, depending on the hook and is_rtl bool * hooks : tc_rtl_colophon_priority * @return void * @param priority number, location string * @package Customizr * @since Customizr 3.3+ */ function czr_fn_set_rtl_colophon_priority( $_priority, $_location ) { if ( ! is_rtl() ) return $_priority; //tc_colophon_right_priority OR tc_colophon_left_priority return 'right' == $_location ? 10 : 30; } /* * Callback of tc_user_options_style hook * @return css string * * @package Customizr * @since Customizr 3.3.27 */ function czr_fn_write_sticky_footer_inline_css( $_css ){ if ( ! ( $this -> is_sticky_footer_enabled() || czr_fn_is_customizing() ) ) return $_css; $_css = sprintf("%s\n%s", $_css, "#tc-push-footer { display: none; visibility: hidden; } .tc-sticky-footer #tc-push-footer.sticky-footer-enabled { display: block; } \n" ); return $_css; } /* * Callback of body_class hook * * @package Customizr * @since Customizr 3.3.27 */ function czr_fn_add_sticky_footer_body_class($_classes) { if ( $this -> is_sticky_footer_enabled() ) $_classes = array_merge( $_classes, array( 'tc-sticky-footer') ); return $_classes; } /** * * Print hookable sticky footer push div * * * @package Customizr * @since Customizr 3.3.27 * * @hook __after_main_container * */ function czr_fn_sticky_footer_push() { if ( ! ( $this -> is_sticky_footer_enabled() || czr_fn_is_customizing() ) ) return; echo ''; } /** * Displays the back to top on scroll * Has to be enabled in the customizer * * @package Customizr * @since Customizr 3.2.0 */ function czr_fn_render_back_to_top() { if ( 0 == esc_attr( czr_fn_opt( 'tc_show_back_to_top' ) ) ) return; printf('