// Header & Footer Code controls (added by assistant) if ( function_exists('add_action') ){ function tn_customize_header_footer( $wp_customize ) { $wp_customize->add_section( 'tn_header_footer_section', array( 'title' => __( 'Header & Footer Code', 'tnnewstheme2025' ), 'priority' => 200, ) ); $wp_customize->add_setting( 'tn_header_code', array( 'default' => '', 'sanitize_callback' => 'tn_sanitize_unfiltered_html', ) ); $wp_customize->add_control( 'tn_header_code', array( 'label' => __( 'Header Code (placed inside
)', 'tnnewstheme2025' ), 'section' => 'tn_header_footer_section', 'type' => 'textarea', ) ); $wp_customize->add_setting( 'tn_footer_code', array( 'default' => '', 'sanitize_callback' => 'tn_sanitize_unfiltered_html', ) ); $wp_customize->add_control( 'tn_footer_code', array( 'label' => __( 'Footer Code (before )', 'tnnewstheme2025' ), 'section' => 'tn_header_footer_section', 'type' => 'textarea', ) ); } add_action( 'customize_register', 'tn_customize_header_footer' ); function tn_sanitize_unfiltered_html( $val ){ if( current_user_can('unfiltered_html') ) return $val; return wp_kses_post($val); } }