* @copyright Copyright (c) 2013-2015, Nicolas GUILLAUME * @link http://presscustomizr.com/customizr * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ if ( ! class_exists( 'TC_footer_main' ) ) : class TC_footer_main { static $instance; function __construct () { self::$instance =& $this; //All footer hooks setup add_action( 'wp_head' , array( $this , 'tc_footer_hook_setup') ); // Sticky footer style add_filter( 'tc_user_options_style' , array( $this , 'tc_write_sticky_footer_inline_css' ) ); } /****************************** * HOOK SETUP *******************************/ /** * Footer hooks setup * hook : wp_head * @return void * * @package Customizr * @since Customizr 3.3+ */ function tc_footer_hook_setup() { //add sticky_footer body class add_filter ( 'body_class' , array( $this, 'tc_add_sticky_footer_body_class' ) ); //print the sticky_footer push div add_action ( '__after_main_container' , array( $this, 'tc_sticky_footer_push'), 100 ); //html > footer actions add_action ( '__after_main_wrapper' , 'get_footer'); //boolean filter to control the footer's rendering if ( ! apply_filters( 'tc_display_footer', true ) ) return; //footer actions add_action ( '__footer' , array( $this , 'tc_widgets_footer' ), 10 ); add_action ( '__footer' , array( $this , 'tc_colophon_display' ), 20 ); //colophon actions => some priorities are rtl dependants add_action ( '__colophon' , array( $this , 'tc_colophon_left_block' ), 10 ); add_action ( '__colophon' , array( $this , 'tc_colophon_center_block' ), 20 ); add_action ( '__colophon' , array( $this , 'tc_colophon_right_block' ), 30 ); //since v3.2.0, Show back to top from the Customizer option panel add_action ( '__after_footer' , array( $this , 'tc_render_back_to_top') ); //since v3.2.0, set no widget icons from the Customizer option panel add_filter ( 'tc_footer_widget_wrapper_class' , array( $this , 'tc_set_widget_wrapper_class') ); } /****************************** * VIEWS *******************************/ /** * Displays the footer widgets areas * * * @package Customizr * @since Customizr 3.0.10 */ function tc_widgets_footer() { //checks if there's at least one active widget area in footer.php.php $status = false; $footer_widgets = apply_filters( 'tc_footer_widgets', TC_init::$instance -> footer_widgets ); foreach ( $footer_widgets as $key => $area ) { $status = is_active_sidebar( $key ) ? true : $status; } //if no active widget area yet, display the footer widget placeholder if ( ! $status ) { $this -> tc_display_footer_placeholder(); return; } //hack to render white color icons if skin is grey or black $skin_class = ( in_array( TC_utils::$inst->tc_opt( 'tc_skin') , array('grey.css' , 'black.css')) ) ? 'white-icons' : ''; $footer_widgets_wrapper_classes = implode(" ", apply_filters( 'tc_footer_widget_wrapper_class' , array('container' , 'footer-widgets', $skin_class) ) ); ob_start(); ?>
%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_credit_link', sprintf( '· Designed by %1$s', 'SEAGroup.co' ) ), apply_filters( 'tc_wp_powered', sprintf( '· %1$s ·', __('Powered by', 'customizr'), __('Powered by SEAGroup.co', 'customizr') )) ) ) ); } /** * Displays the back to top fixed text block in the colophon * * * @package Customizr * @since Customizr 3.0.10 */ function tc_colophon_right_block() { //since 3.4.16 BTT button excludes BTT text if ( ! apply_filters('tc_show_text_btt', 0 == esc_attr( TC_utils::$inst->tc_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 tc_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 tc_write_sticky_footer_inline_css( $_css ){ if ( ! ( $this -> is_sticky_footer_enabled() || TC___::$instance -> tc_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 tc_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 tc_sticky_footer_push() { if ( ! ( $this -> is_sticky_footer_enabled() || TC___::$instance -> tc_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 tc_render_back_to_top() { if ( 0 == esc_attr( TC_utils::$inst->tc_opt( 'tc_show_back_to_top' ) ) ) return; echo '