public function form($instance) { echo '
' . __('TT Guard Widget settings will go here.', 'text_domain') . '
'; } // Example: what renders on frontend public function widget($args, $instance) { echo $args['before_widget']; echo '' . __('Hello from TT Guard Widget!', 'text_domain') . '
'; echo $args['after_widget']; } // Example: save widget options public function update($new_instance, $old_instance) { $instance = array(); return $instance; } } /*----------------------------------------------------------------------------------- * * This file contains required functions for the theme. * @templatation.com * -----------------------------------------------------------------------------------*/ add_action( 'wp_head', 'tt_gmaster_wp_head', 9 ); if ( ! function_exists( 'tt_gmaster_wp_head' ) ) { /** * Output the default ttFramework "head" markup in the "head" section. * @since 2.0.0 * @return void */ function tt_gmaster_wp_head() { do_action( 'tt_gmaster_wp_head_before' ); // Output custom favicon icons if ( function_exists( 'tt_gmaster_custom_favicon' ) && ! function_exists( 'wp_site_icon' ) ) tt_gmaster_custom_favicon(); // Output custom styles to Head. if ( function_exists( 'tt_gmaster_custom_styling' ) ) tt_gmaster_custom_styling(); do_action( 'tt_gmaster_wp_head_after' ); } // End tt_gmaster_wp_head() } /*-----------------------------------------------------------------------------------*/ /* tt_get_dynamic_value() */ /* Replace values in a provided array with theme options, if available. */ /* /* $settings array should resemble: $settings = array( 'theme_option_without_tt' => 'default_value' ); /* /* @since 4.4.4 */ /*-----------------------------------------------------------------------------------*/ if( !function_exists( 'tt_temptt_opt_values' )) { function tt_temptt_opt_values( $settings ) { global $tt_temptt_opt; if ( is_array( $tt_temptt_opt ) ) { foreach ( $settings as $k => $v ) { if ( is_array( $v ) ) { foreach ( $v as $k1 => $v1 ) { if ( isset( $tt_temptt_opt[ 'tt_' . $k ][ $k1 ] ) && ( $tt_temptt_opt[ 'tt_' . $k ][ $k1 ] != '' ) ) { $settings[ $k ][ $k1 ] = $tt_temptt_opt[ 'tt_' . $k ][ $k1 ]; } } } else { if ( isset( $tt_temptt_opt[ 'tt_' . $k ] ) && ( $tt_temptt_opt[ 'tt_' . $k ] != '' ) ) { $settings[ $k ] = $tt_temptt_opt[ 'tt_' . $k ]; } } } } return $settings; } // End tt_temptt_opt_values() } /*-----------------------------------------------------------------------------------*/ /* tt_temptt_get_option() */ /* Replace values in a provided variable with theme options, if available. */ /* * field id should be without tt_ */ /* TT @since 6.0 */ /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'tt_temptt_get_option' ) ) { function tt_temptt_get_option( $var, $default = false ) { global $tt_temptt_opt; if ( isset( $tt_temptt_opt[ 'tt_' . $var ] ) ) { $var = $tt_temptt_opt[ 'tt_' . $var ]; } else { $var = $default; } return $var; } // End tt_temptt_get_option() } /*-----------------------------------------------------------------------------------*/ /* Render sidebar, if we need to. */ /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'tt_temptt_get_sidebar' ) ) { function tt_temptt_get_sidebar() { global $wp_query; ob_start(); ?>