Dashboard
PHP:
8.1.33
OS:
Linux
User:
lawtemple
/
/
home
/
www
/
lawtemplefirm.com
/
wp-content
/
themes
/
law-temple-theme
/
inc
📤 Upload
📝 New File
📁 New Folder
Close
Editing: settings.php
<?php if ( ! defined( 'ABSPATH' ) ) { exit; } function lt_theme_defaults() { return array( 'preset' => 'classic', 'logo_primary'=>0,'logo_alt'=>0,'logo_light'=>0,'logo_dark'=>0,'logo_sticky'=>0,'logo_mobile'=>0,'logo_footer'=>0,'favicon'=>0, 'logo_width'=>205,'logo_mobile_width'=>172,'logo_height'=>0,'logo_spacing'=>0, 'primary'=>'#064559','secondary'=>'#102B3A','accent'=>'#BB8031','gold'=>'#BB8031','heading'=>'#064559','text'=>'#20272B','muted'=>'#667078','link'=>'#064559','link_hover'=>'#9E6927','background'=>'#FFFFFF','alternate'=>'#FAF8F4','dark'=>'#102B3A','border'=>'#E6E1D8','button'=>'#064559','button_hover'=>'#0A586F','header'=>'#FFFFFF','header_text'=>'#243239','footer'=>'#102B3A','footer_text'=>'#DCE4E7', 'font_source'=>'system','google_body_family'=>'Inter','google_heading_family'=>'Cormorant Garamond', 'body_font'=>'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif','heading_font'=>'Georgia, "Times New Roman", serif','nav_font'=>'Inter, system-ui, sans-serif','button_font'=>'Inter, system-ui, sans-serif','accent_font'=>'Georgia, serif', 'body_size'=>16,'body_line'=>1.65,'body_letter'=>0,'body_weight'=>400, 'h1_size'=>64,'h2_size'=>46,'h3_size'=>28,'h4_size'=>23,'h5_size'=>19,'h6_size'=>16,'heading_weight'=>500,'heading_line'=>1.04,'heading_letter'=>0,'heading_transform'=>'none', 'nav_size'=>14,'nav_weight'=>600,'nav_letter'=>0.25,'nav_transform'=>'none', 'button_size'=>13,'button_weight'=>600,'button_letter'=>0.25,'button_transform'=>'none', 'accent_size'=>12,'accent_weight'=>700,'accent_letter'=>1.6,'accent_transform'=>'uppercase', 'tablet_h1'=>54,'tablet_h2'=>40,'tablet_body'=>16,'mobile_h1'=>40,'mobile_h2'=>32,'mobile_body'=>16, 'tablet_section_y'=>62,'mobile_section_y'=>46,'tablet_grid_gap'=>24,'mobile_grid_gap'=>18,'tablet_gutter'=>24,'mobile_gutter'=>18,'hero_tablet_height'=>540, 'site_layout'=>'full','site_width'=>1440,'content_width'=>1160,'wide_width'=>1320,'header_width'=>1180,'section_y'=>78,'section_x'=>24,'grid_gap'=>32,'card_padding'=>0,'radius'=>0,'border_width'=>1,'button_radius'=>0,'button_pad_y'=>12,'button_pad_x'=>20,'sidebar_width'=>320,'card_image_ratio'=>'3/2','portrait_ratio'=>'4/5', 'button_primary_bg'=>'#064559','button_primary_text'=>'#FFFFFF','button_secondary_bg'=>'#102B3A','button_secondary_text'=>'#FFFFFF','button_gold_bg'=>'#BB8031','button_gold_text'=>'#FFFFFF','button_outline_color'=>'#064559','button_dark_bg'=>'#102B3A','button_dark_text'=>'#FFFFFF','button_light_bg'=>'#FFFFFF','button_light_text'=>'#064559','button_hover_lift'=>0, 'card_background'=>'#FFFFFF','card_border'=>'#E7E3DB','card_shadow'=>'none','card_hover'=>'image','card_image_visibility'=>1, 'header_source'=>'theme','header_pattern_id'=>0,'header_layout'=>'logo-left','sticky_header'=>1,'transparent_header'=>0,'header_height'=>80,'header_cta_label'=>__('Enquiry','law-temple-theme'),'header_cta_url'=>'','show_home_menu_item'=>0,'show_search'=>1,'show_topbar'=>0,'topbar_text'=>'','topbar_background'=>'#FBFAF7','topbar_text_color'=>'#1F2427','announcement'=>0,'announcement_text'=>'','announcement_url'=>'','announcement_background'=>'#064559','announcement_text_color'=>'#FFFFFF','mobile_menu_layout'=>'drawer','mobile_drawer_width'=>92,'mobile_sticky_header'=>1,'mobile_show_topbar'=>0,'mobile_show_announcement'=>1,'mobile_show_header_cta'=>0, 'hero_autoplay'=>1,'hero_duration'=>6000,'hero_transition'=>'fade','hero_navigation'=>'dots-arrows','hero_pause'=>1,'hero_loop'=>1,'hero_desktop_height'=>600,'hero_mobile_height'=>520,'mobile_hero_media_height'=>320,'mobile_hero_media_position'=>'below','mobile_hero_hide_media'=>0,'mobile_hero_stack_buttons'=>1, 'footer_source'=>'theme','footer_pattern_id'=>0,'footer_layout'=>'columns','footer_description'=>'','footer_columns'=>3,'footer_show_practices'=>1,'footer_show_insights'=>0,'footer_show_social'=>1,'footer_show_regulatory'=>1,'footer_show_office'=>1,'newsletter_shortcode'=>'', 'home_order'=>'hero,intro,practices,people,values,insights,contact,sectors,matters,testimonials,awards,offices,careers,faq,custom','home_disabled'=>'sectors,matters,testimonials,awards,offices,careers,faq,custom','home_practice_ids'=>'','home_lawyer_ids'=>'','home_insight_ids'=>'','home_practice_count'=>7,'home_people_count'=>4,'home_insight_count'=>3,'global_cta_id'=>0, 'intro_heading'=>__('Professional counsel. Practical judgment.','law-temple-theme'),'intro_text'=>'','values_heading'=>__('What guides our work','law-temple-theme'),'values_items'=>__('Integrity|Professional independence and ethical responsibility.\nClarity|Complex issues explained in practical terms.\nResponsiveness|Timely support when timing matters.\nJudgment|Advice shaped by law, context and consequence.','law-temple-theme'), 'home_intro_bg'=>'#FFFFFF','home_practices_bg'=>'#FBFAF7','home_sectors_bg'=>'#FFFFFF','home_people_bg'=>'#FFFFFF','home_values_bg'=>'#102B3A','home_matters_bg'=>'#FFFFFF','home_testimonials_bg'=>'#FBFAF7','home_awards_bg'=>'#FFFFFF','home_insights_bg'=>'#FBFAF7','home_offices_bg'=>'#FFFFFF','home_careers_bg'=>'#FBFAF7','home_faq_bg'=>'#FFFFFF','home_contact_bg'=>'#FFFFFF', 'practice_archive_heading'=>'','practice_archive_intro'=>'','people_archive_heading'=>'','people_archive_intro'=>'','insight_archive_heading'=>'','insight_archive_intro'=>'','matter_archive_heading'=>'','matter_archive_intro'=>'','office_archive_heading'=>'','office_archive_intro'=>'','career_archive_heading'=>'','career_archive_intro'=>'','testimonial_archive_heading'=>'','testimonial_archive_intro'=>'','award_archive_heading'=>'','award_archive_intro'=>'', 'practice_archive_layout'=>'numbered','lawyer_archive_layout'=>'portrait','insight_archive_layout'=>'grid','matter_archive_layout'=>'grid','office_archive_layout'=>'grid','career_archive_layout'=>'list','testimonial_archive_layout'=>'quotes','award_archive_layout'=>'grid', 'archive_columns'=>3,'archive_columns_tablet'=>2,'archive_columns_mobile'=>1,'archive_per_page'=>12,'archive_show_filters'=>1,'archive_show_images'=>1,'archive_show_excerpts'=>1,'archive_hero_style'=>'surface','matter_archive_columns'=>3,'office_archive_columns'=>3,'career_archive_columns'=>1,'testimonial_archive_columns'=>2,'award_archive_columns'=>3, 'profile_layout'=>'split','profile_nav_sticky'=>1,'profile_show_photo'=>1,'profile_contact_rail'=>0,'profile_content_width'=>'standard','profile_order'=>'hero,biography,practice,sector,experience,qualifications,education,bar,memberships,languages,matters,awards,publications,insights,downloads,contact','profile_disabled'=>'', 'practice_single_layout'=>'editorial','practice_show_image'=>1,'practice_sticky_summary'=>0,'practice_content_width'=>'standard','practice_order'=>'hero,overview,services,capabilities,sectors,lawyers,matters,awards,insights,faq,contact','practice_disabled'=>'', 'mega_menu_target'=>'expertise','mega_menu_show_practices'=>1,'mega_menu_show_sectors'=>1,'mega_menu_practice_count'=>8,'mega_menu_sector_count'=>8,'mega_menu_practice_heading'=>'Practice Areas','mega_menu_sector_heading'=>'Sectors','mega_menu_cta_label'=>'View all expertise','mega_menu_cta_url'=>'','breadcrumbs'=>1,'search_suggestions'=>8,'breadcrumb_home'=>__('Home','law-temple-theme'),'breadcrumb_separator'=>'/','animations'=>1,'live_search'=>1,'mega_menu'=>0,'print_styles'=>1,'social_sharing'=>1, 'page_default_hero_layout'=>'minimal','page_default_layout'=>'full','page_default_breadcrumbs'=>'inherit','page_default_header_style'=>'standard','page_default_footer_style'=>'standard','page_default_cta'=>'inherit','mobile_breadcrumbs'=>1,'mobile_profile_nav'=>'scroll','mobile_filters_layout'=>'stack','mobile_footer_align'=>'left', '404_heading'=>__('Page not found','law-temple-theme'),'404_message'=>__('The page may have moved or the address may be incorrect. Search the site or explore our services.','law-temple-theme'),'404_show_search'=>1,'404_show_practices'=>1,'404_cta_label'=>'','404_cta_url'=>'', 'custom_header_scripts'=>'','custom_footer_scripts'=>'', ); } function lt_theme_options() { return wp_parse_args( get_option( 'lt_theme_options_v3', array() ), lt_theme_defaults() ); } function lt_theme_option( $key, $fallback = '' ) { $o = lt_theme_options(); return array_key_exists( $key, $o ) ? $o[ $key ] : $fallback; } function lt_theme_register_settings() { register_setting( 'lt_theme_settings', 'lt_theme_options_v3', array( 'sanitize_callback'=>'lt_theme_sanitize_options', 'default'=>lt_theme_defaults() ) ); } function lt_theme_int_limits() { return array( 'logo_width'=>array(100,420),'logo_mobile_width'=>array(80,320),'logo_height'=>array(0,240),'logo_spacing'=>array(0,80), 'body_size'=>array(14,22),'body_weight'=>array(100,900),'heading_weight'=>array(100,900),'nav_weight'=>array(100,900),'button_weight'=>array(100,900),'accent_weight'=>array(100,900),'h1_size'=>array(32,96),'h2_size'=>array(28,76),'h3_size'=>array(22,56),'h4_size'=>array(18,44),'h5_size'=>array(16,36),'h6_size'=>array(14,30), 'nav_size'=>array(12,20),'button_size'=>array(12,20),'accent_size'=>array(11,22),'tablet_h1'=>array(30,80),'tablet_h2'=>array(26,64),'tablet_body'=>array(14,21),'mobile_h1'=>array(30,64),'mobile_h2'=>array(24,52),'mobile_body'=>array(14,20), 'site_width'=>array(960,1920),'content_width'=>array(700,1440),'wide_width'=>array(900,1800),'header_width'=>array(900,1920),'section_y'=>array(32,160),'section_x'=>array(0,96),'grid_gap'=>array(12,80),'card_padding'=>array(0,64),'radius'=>array(0,32),'border_width'=>array(0,6), 'button_radius'=>array(0,40),'button_pad_y'=>array(6,28),'button_pad_x'=>array(10,48),'sidebar_width'=>array(220,480),'header_height'=>array(56,130),'footer_columns'=>array(1,4), 'hero_desktop_height'=>array(360,1000),'hero_tablet_height'=>array(320,900),'hero_mobile_height'=>array(280,900),'mobile_hero_media_height'=>array(180,720),'mobile_drawer_width'=>array(70,100), 'tablet_section_y'=>array(28,140),'mobile_section_y'=>array(24,120),'tablet_grid_gap'=>array(10,64),'mobile_grid_gap'=>array(8,48),'tablet_gutter'=>array(16,64),'mobile_gutter'=>array(14,40), 'archive_columns'=>array(1,4),'archive_columns_tablet'=>array(1,3),'archive_columns_mobile'=>array(1,2),'archive_per_page'=>array(3,48),'matter_archive_columns'=>array(1,4),'office_archive_columns'=>array(1,4),'career_archive_columns'=>array(1,4),'testimonial_archive_columns'=>array(1,4),'award_archive_columns'=>array(1,4),'search_suggestions'=>array(3,20), 'home_practice_count'=>array(1,24),'home_people_count'=>array(1,24),'home_insight_count'=>array(1,24),'mega_menu_practice_count'=>array(1,20),'mega_menu_sector_count'=>array(1,20), ); } function lt_theme_clamp_int_option( $key, $value ) { $value = absint( $value ); $limits = lt_theme_int_limits(); if ( isset( $limits[$key] ) ) { $value = max( $limits[$key][0], min( $limits[$key][1], $value ) ); } return $value; } function lt_theme_float_limits() { return array( 'body_line'=>array(1.2,2.2),'heading_line'=>array(0.9,1.5), 'body_letter'=>array(-1.5,4.0),'heading_letter'=>array(-2.0,5.0),'nav_letter'=>array(-0.5,4.0),'button_letter'=>array(-0.5,4.0),'accent_letter'=>array(-0.5,5.0), ); } function lt_theme_clamp_float_option( $key, $value ) { $value=(float)$value; $limits=lt_theme_float_limits(); if(isset($limits[$key]))$value=max($limits[$key][0],min($limits[$key][1],$value)); return $value; } function lt_theme_sanitize_options( $input ) { $defaults = lt_theme_defaults(); $old = lt_theme_options(); $input = is_array( $input ) ? $input : array(); $out = $old; $colors = array('primary','secondary','accent','gold','heading','text','muted','link','link_hover','background','alternate','dark','border','button','button_hover','header','header_text','footer','footer_text','button_primary_bg','button_primary_text','button_secondary_bg','button_secondary_text','button_gold_bg','button_gold_text','button_outline_color','button_dark_bg','button_dark_text','button_light_bg','button_light_text','card_background','card_border','topbar_background','topbar_text_color','announcement_background','announcement_text_color','home_intro_bg','home_practices_bg','home_sectors_bg','home_people_bg','home_values_bg','home_matters_bg','home_testimonials_bg','home_awards_bg','home_insights_bg','home_offices_bg','home_careers_bg','home_faq_bg','home_contact_bg'); $ints = array('header_pattern_id','footer_pattern_id','logo_primary','logo_alt','logo_light','logo_dark','logo_sticky','logo_mobile','logo_footer','favicon','logo_width','logo_mobile_width','mobile_drawer_width','mobile_hero_media_height','logo_height','logo_spacing','body_size','body_weight','h1_size','h2_size','h3_size','h4_size','h5_size','h6_size','heading_weight','nav_size','nav_weight','button_size','button_weight','accent_size','accent_weight','tablet_h1','tablet_h2','tablet_body','mobile_h1','mobile_h2','mobile_body','tablet_section_y','mobile_section_y','tablet_grid_gap','mobile_grid_gap','tablet_gutter','mobile_gutter','hero_tablet_height','site_width','content_width','wide_width','header_width','section_y','section_x','grid_gap','card_padding','radius','border_width','button_radius','button_pad_y','button_pad_x','sidebar_width','button_hover_lift','header_height','footer_columns','home_practice_count','home_people_count','home_insight_count','global_cta_id','hero_duration','hero_desktop_height','hero_mobile_height','archive_columns','archive_columns_tablet','archive_columns_mobile','archive_per_page','matter_archive_columns','office_archive_columns','career_archive_columns','testimonial_archive_columns','award_archive_columns','search_suggestions','mega_menu_practice_count','mega_menu_sector_count'); $bools = array('404_show_search','404_show_practices','card_image_visibility','sticky_header','mobile_sticky_header','transparent_header','show_home_menu_item','show_search','show_topbar','mobile_show_topbar','announcement','mobile_show_announcement','mobile_show_header_cta','footer_show_practices','footer_show_insights','footer_show_social','footer_show_regulatory','footer_show_office','hero_autoplay','hero_pause','hero_loop','mobile_hero_hide_media','mobile_hero_stack_buttons','breadcrumbs','mobile_breadcrumbs','animations','live_search','mega_menu','mega_menu_show_practices','mega_menu_show_sectors','archive_show_filters','archive_show_images','archive_show_excerpts','profile_nav_sticky','profile_show_photo','profile_contact_rail','practice_show_image','practice_sticky_summary','print_styles','social_sharing'); $urls = array('header_cta_url','announcement_url','404_cta_url','mega_menu_cta_url'); $textarea = array('404_message','intro_text','values_items','footer_description','practice_archive_intro','people_archive_intro','insight_archive_intro','matter_archive_intro','office_archive_intro','career_archive_intro','testimonial_archive_intro','award_archive_intro'); $floats = array('body_line','body_letter','heading_line','heading_letter','nav_letter','button_letter','accent_letter'); foreach ( $defaults as $key => $default ) { if ( ! array_key_exists( $key, $input ) ) { continue; } $value = $input[ $key ]; if ( in_array( $key, $colors, true ) ) { $out[$key] = sanitize_hex_color( $value ) ?: $default; } elseif ( in_array( $key, $ints, true ) ) { $out[$key] = lt_theme_clamp_int_option( $key, $value ); } elseif ( in_array( $key, $bools, true ) ) { $out[$key] = empty( $value ) ? 0 : 1; } elseif ( in_array( $key, $urls, true ) ) { $out[$key] = esc_url_raw( $value ); } elseif ( in_array( $key, $floats, true ) ) { $out[$key] = lt_theme_clamp_float_option( $key, $value ); } elseif ( in_array( $key, array('home_practice_ids','home_lawyer_ids','home_insight_ids'), true ) ) { $out[$key] = function_exists('lt_core_sanitize_csv_ids') ? lt_core_sanitize_csv_ids($value) : implode(',',array_filter(array_map('absint',(array)$value))); } elseif ( in_array( $key, array('custom_header_scripts','custom_footer_scripts'), true ) ) { $out[$key] = current_user_can('unfiltered_html') ? $value : ''; } elseif ( in_array( $key, $textarea, true ) ) { $out[$key] = sanitize_textarea_field( $value ); } else { $out[$key] = sanitize_text_field( $value ); } } return apply_filters( 'lt_theme_sanitized_options', $out, $input ); } function lt_theme_options_admin_url( $tab = '' ) { $base = defined( 'LT_CORE_VERSION' ) ? admin_url( 'admin.php?page=lt-theme-options' ) : admin_url( 'themes.php?page=lt-theme-options' ); if ( $tab ) { $base = add_query_arg( 'tab', sanitize_key( $tab ), $base ); } return $base; } function lt_theme_admin_menu() { if ( defined( 'LT_CORE_VERSION' ) ) { add_submenu_page( 'lt-core-dashboard', __( 'Law Firm Theme Options', 'law-temple-theme' ), __( 'Theme Options', 'law-temple-theme' ), 'edit_theme_options', 'lt-theme-options', 'lt_theme_options_page' ); } else { add_theme_page( __( 'Law Firm Theme Options', 'law-temple-theme' ), __( 'Law Firm Theme Options', 'law-temple-theme' ), 'edit_theme_options', 'lt-theme-options', 'lt_theme_options_page' ); } } function lt_theme_reorder_core_submenu() { if ( ! defined( 'LT_CORE_VERSION' ) ) { return; } global $submenu; if ( empty( $submenu['lt-core-dashboard'] ) || ! is_array( $submenu['lt-core-dashboard'] ) ) { return; } $theme_item = null; foreach ( $submenu['lt-core-dashboard'] as $index => $item ) { if ( isset( $item[2] ) && 'lt-theme-options' === $item[2] ) { $theme_item = $item; unset( $submenu['lt-core-dashboard'][ $index ] ); break; } } if ( $theme_item ) { $items = array_values( $submenu['lt-core-dashboard'] ); array_splice( $items, 1, 0, array( $theme_item ) ); $submenu['lt-core-dashboard'] = $items; } } function lt_theme_admin_assets( $hook ) { $is_options = false !== strpos( (string) $hook, 'lt-theme-options' ); if ( ! $is_options && 'post.php' !== $hook && 'post-new.php' !== $hook ) { return; } wp_enqueue_media(); wp_enqueue_style( 'lt-theme-admin', LT_THEME_URL . 'assets/css/admin.css', array(), LT_THEME_VERSION ); wp_enqueue_script( 'lt-theme-admin', LT_THEME_URL . 'assets/js/admin.js', array(), LT_THEME_VERSION, true ); wp_localize_script( 'lt-theme-admin', 'ltThemeAdmin', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'relationNonce' => wp_create_nonce( 'lt_relation_search' ), 'noResults' => __( 'No matching records found.', 'law-temple-theme' ), 'relationError' => __( 'Relationship search is unavailable.', 'law-temple-theme' ), ) ); } function lt_theme_tabs() { return array( 'overview' => __( 'Overview', 'law-temple-theme' ), 'branding' => __( 'Branding & Colours', 'law-temple-theme' ), 'typography' => __( 'Typography', 'law-temple-theme' ), 'layout' => __( 'Layout', 'law-temple-theme' ), 'components' => __( 'Buttons & Cards', 'law-temple-theme' ), 'header' => __( 'Header & Navigation', 'law-temple-theme' ), 'hero' => __( 'Hero', 'law-temple-theme' ), 'homepage' => __( 'Homepage', 'law-temple-theme' ), 'pages' => __( 'Pages', 'law-temple-theme' ), 'footer' => __( 'Footer', 'law-temple-theme' ), 'archives' => __( 'Archives', 'law-temple-theme' ), 'profiles' => __( 'Profiles & Practice Pages', 'law-temple-theme' ), 'responsive' => __( 'Responsive', 'law-temple-theme' ), 'behaviour' => __( 'Behaviour & Utilities', 'law-temple-theme' ), 'tools' => __( 'Export / Import / Reset', 'law-temple-theme' ), ); } function lt_theme_tab_keywords() { return array( 'overview' => 'dashboard summary preset status shortcuts', 'branding' => 'logo favicon brand colours colors palette primary secondary gold accent site icon', 'typography' => 'font fonts heading body navigation button label h1 h2 h3 weight line height letter spacing', 'layout' => 'width content spacing grid radius border sidebar desktop structure boxed full', 'components' => 'button buttons cards shadow hover background border image', 'header' => 'header navigation menu top bar announcement search cta mega menu expertise sticky transparent', 'hero' => 'hero slider carousel autoplay transition duration arrows dots height banner slides', 'homepage' => 'home homepage sections order feature practices people insights values backgrounds cta', 'pages' => 'pages page defaults hero breadcrumbs sidebar full width header footer cta override', 'footer' => 'footer columns social office regulatory newsletter copyright menus', 'archives' => 'archive expertise people insights matters offices careers testimonials awards filters columns layout headings', 'profiles' => 'lawyer attorney professional profile practice single page biography sections contact rail sticky summary', 'responsive' => 'responsive tablet mobile phone typography spacing grid hero logo menu columns', 'behaviour' => 'breadcrumbs search animations sharing print 404 scripts utilities', 'tools' => 'export import backup restore reset settings json', ); } function lt_theme_options_page() { if ( ! current_user_can( 'edit_theme_options' ) ) { return; } lt_theme_handle_tools(); $tabs = lt_theme_tabs(); $active = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : 'overview'; $aliases = array( 'builders'=>'profiles' ); if ( isset( $aliases[ $active ] ) ) { $active = $aliases[ $active ]; } if ( ! isset( $tabs[ $active ] ) ) { $active = 'overview'; } echo '<div class="wrap lt-theme-hub"><div class="lt-theme-hub__title"><div><h1>' . esc_html__( 'Law Firm Theme Options', 'law-temple-theme' ) . '</h1><p>' . esc_html__( 'All global presentation and design controls are consolidated here. Structured legal content remains in Law Firm content areas and is never deleted by design changes.', 'law-temple-theme' ) . '</p></div>'; echo '<div class="lt-theme-hub__actions"><a class="button" href="' . esc_url( home_url( '/' ) ) . '" target="_blank" rel="noopener">' . esc_html__( 'View site', 'law-temple-theme' ) . '</a>'; if ( defined( 'LT_CORE_VERSION' ) ) { echo '<a class="button" href="' . esc_url( admin_url( 'admin.php?page=lt-page-builder' ) ) . '">' . esc_html__( 'Page Builder', 'law-temple-theme' ) . '</a><a class="button button-primary" href="' . esc_url( admin_url( 'admin.php?page=lt-hero-manager' ) ) . '">' . esc_html__( 'Manage Hero Slides', 'law-temple-theme' ) . '</a>'; } echo '</div></div>'; echo '<div class="lt-theme-hub__search"><label for="lt-theme-option-search"><span class="dashicons dashicons-search" aria-hidden="true"></span><span class="screen-reader-text">' . esc_html__( 'Search Theme Options', 'law-temple-theme' ) . '</span></label><input type="search" id="lt-theme-option-search" placeholder="' . esc_attr__( 'Find branding, header, hero, footer, responsive, archive…', 'law-temple-theme' ) . '" autocomplete="off"></div>'; echo '<nav class="nav-tab-wrapper lt-theme-hub__tabs" aria-label="' . esc_attr__( 'Theme option sections', 'law-temple-theme' ) . '">'; $keywords = lt_theme_tab_keywords(); foreach ( $tabs as $slug => $label ) { $search = strtolower( $label . ' ' . ( $keywords[ $slug ] ?? '' ) ); echo '<a data-lt-theme-tab="' . esc_attr( $search ) . '" class="nav-tab ' . ( $active === $slug ? 'nav-tab-active' : '' ) . '" href="' . esc_url( lt_theme_options_admin_url( $slug ) ) . '">' . esc_html( $label ) . '</a>'; } echo '</nav>'; if ( 'overview' === $active ) { echo '<div class="lt-theme-options lt-theme-options--overview">'; lt_theme_render_tab( $active ); echo '</div>'; } elseif ( 'tools' === $active ) { echo '<div class="lt-theme-options">'; lt_theme_render_tab( $active ); echo '</div>'; } else { echo '<form method="post" action="options.php" class="lt-theme-options" data-lt-theme-options-form>'; settings_fields( 'lt_theme_settings' ); lt_theme_render_tab( $active ); submit_button( __( 'Save Theme Options', 'law-temple-theme' ) ); echo '</form>'; } echo '</div>'; } function lt_theme_field( $key, $label, $type='text', $choices=array(), $description='' ) { $value = lt_theme_option($key); $name='lt_theme_options_v3['.$key.']'; echo '<div class="lt-option-row"><label for="ltopt_'.esc_attr($key).'"><strong>'.esc_html($label).'</strong></label><div>'; if('checkbox'===$type) echo '<input type="hidden" name="'.esc_attr($name).'" value="0"><label><input type="checkbox" id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'" value="1" '.checked($value,1,false).'> '.esc_html__('Enabled','law-temple-theme').'</label>'; elseif('select'===$type){echo '<select id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'">';foreach($choices as $a=>$b)echo '<option value="'.esc_attr($a).'" '.selected($value,$a,false).'>'.esc_html($b).'</option>';echo '</select>';} elseif('textarea'===$type) echo '<textarea rows="5" class="large-text" id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'">'.esc_textarea($value).'</textarea>'; elseif('color'===$type) echo '<input type="color" id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'" value="'.esc_attr($value).'"> <code>'.esc_html($value).'</code>'; elseif('media'===$type){$img=$value?wp_get_attachment_image(absint($value),'thumbnail'):'';echo '<div class="lt-media-field"><div class="lt-media-preview">'.$img.'</div><input type="hidden" id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'" value="'.esc_attr(absint($value)).'"><button type="button" class="button lt-media-select">'.esc_html__('Choose media','law-temple-theme').'</button> <button type="button" class="button-link-delete lt-media-remove">'.esc_html__('Remove','law-temple-theme').'</button></div>';} elseif('wp_block'===$type){$items=get_posts(array('post_type'=>'wp_block','post_status'=>array('publish','draft'),'posts_per_page'=>100,'orderby'=>'title','order'=>'ASC'));echo '<select id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'"><option value="0">'.esc_html__('Select synced pattern','law-temple-theme').'</option>';foreach($items as $item)echo '<option value="'.esc_attr($item->ID).'" '.selected(absint($value),$item->ID,false).'>'.esc_html($item->post_title ?: sprintf(__('Pattern #%d','law-temple-theme'),$item->ID)).'</option>';echo '</select><p class="description">'.esc_html__('Create or edit synced patterns from the WordPress Patterns screen. Only published patterns render publicly.','law-temple-theme').'</p>';} elseif('multiselect'===$type){$selected=function_exists('lt_core_csv_ids')?lt_core_csv_ids($value):array_filter(array_map('absint',explode(',',(string)$value)));echo '<select multiple size="7" id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'[]">';foreach($choices as $a=>$b)echo '<option value="'.esc_attr($a).'" '.selected(in_array((int)$a,$selected,true),true,false).'>'.esc_html($b).'</option>';echo '</select>';} else echo '<input class="regular-text" type="'.esc_attr(in_array($type,array('number','url'),true)?$type:'text').'" id="ltopt_'.esc_attr($key).'" name="'.esc_attr($name).'" value="'.esc_attr($value).'">'; if($description) echo '<p class="description">'.esc_html($description).'</p>'; echo '</div></div>'; } function lt_theme_section_manager($order_key,$disabled_key,$labels){ $order=array_filter(array_map('sanitize_key',explode(',',(string)lt_theme_option($order_key))));foreach(array_keys($labels) as $key)if(!in_array($key,$order,true))$order[]=$key;$disabled=array_filter(array_map('sanitize_key',explode(',',(string)lt_theme_option($disabled_key)))); echo '<div class="lt-option-row lt-option-row--section-manager"><label><strong>'.esc_html__('Visual section manager','law-temple-theme').'</strong><span class="description">'.esc_html__('Drag to reorder. Toggle sections without deleting their content.','law-temple-theme').'</span></label><div><input type="hidden" class="lt-section-order-input" name="lt_theme_options_v3['.esc_attr($order_key).']" value="'.esc_attr(implode(',',$order)).'"><input type="hidden" class="lt-section-disabled-input" name="lt_theme_options_v3['.esc_attr($disabled_key).']" value="'.esc_attr(implode(',',$disabled)).'"><ul class="lt-section-sortable lt-section-card-list">'; foreach($order as $key){if(!isset($labels[$key]))continue;$meta=function_exists('lt_theme_section_admin_meta')?lt_theme_section_admin_meta($key):array('dashicons-admin-generic','');echo '<li draggable="true" data-section="'.esc_attr($key).'"><span class="dashicons dashicons-move lt-drag-handle"></span><span class="dashicons '.esc_attr($meta[0]).' lt-section-icon"></span><span class="lt-section-copy"><strong class="lt-section-name">'.esc_html($labels[$key]).'</strong><small>'.esc_html($meta[1]).'</small></span><label class="lt-switch"><input class="lt-section-enabled" type="checkbox" '.checked(!in_array($key,$disabled,true),true,false).'><span>'.esc_html__('Enabled','law-temple-theme').'</span></label></li>';} echo '</ul></div></div>'; } function lt_theme_home_background_fields(){ $labels=array('intro'=>__('Firm introduction','law-temple-theme'),'practices'=>__('Practice Areas','law-temple-theme'),'sectors'=>__('Sectors','law-temple-theme'),'people'=>__('People','law-temple-theme'),'values'=>__('Values','law-temple-theme'),'matters'=>__('Representative matters','law-temple-theme'),'testimonials'=>__('Testimonials','law-temple-theme'),'awards'=>__('Awards','law-temple-theme'),'insights'=>__('Insights','law-temple-theme'),'offices'=>__('Offices','law-temple-theme'),'careers'=>__('Careers','law-temple-theme'),'faq'=>__('FAQ','law-temple-theme'),'contact'=>__('Contact','law-temple-theme')); echo '<h2>'.esc_html__('Homepage section backgrounds','law-temple-theme').'</h2>'; foreach($labels as $key=>$label) lt_theme_field('home_'.$key.'_bg',sprintf(__('%s background','law-temple-theme'),$label),'color'); } function lt_theme_render_tab($tab){ $layouts=array('logo-left'=>__('Logo left, navigation right','law-temple-theme'),'centered'=>__('Logo centred','law-temple-theme'),'menu-center'=>__('Logo left, menu centre, CTA right','law-temple-theme'),'topbar'=>__('Top contact bar + navigation','law-temple-theme'),'transparent'=>__('Transparent over hero','law-temple-theme'),'minimal'=>__('Minimal professional','law-temple-theme')); if('overview'===$tab){ $preset=lt_theme_option('preset','classic'); $home_disabled=array_filter(array_map('sanitize_key',explode(',',(string)lt_theme_option('home_disabled')))); $home_order=array_filter(array_map('sanitize_key',explode(',',(string)lt_theme_option('home_order')))); $active_sections=max(0,count($home_order)-count($home_disabled)); $hero_count=post_type_exists('hero_slide')?(int)wp_count_posts('hero_slide')->publish:0; $practice_count=post_type_exists('practice')?(int)wp_count_posts('practice')->publish:0; $people_count=post_type_exists('lawyer')?(int)wp_count_posts('lawyer')->publish:0; echo '<section class="lt-theme-overview-summary"><div><span>'.esc_html__('Active preset','law-temple-theme').'</span><strong>'.esc_html(ucwords(str_replace('-',' ',$preset))).'</strong></div><div><span>'.esc_html__('Homepage sections','law-temple-theme').'</span><strong>'.esc_html((string)$active_sections).'</strong></div><div><span>'.esc_html__('Hero slides','law-temple-theme').'</span><strong>'.esc_html((string)$hero_count).'</strong></div><div><span>'.esc_html__('Practice Areas','law-temple-theme').'</span><strong>'.esc_html((string)$practice_count).'</strong></div><div><span>'.esc_html__('People','law-temple-theme').'</span><strong>'.esc_html((string)$people_count).'</strong></div></section>'; $cards=array( 'branding'=>array('dashicons-art',__('Branding & Colours','law-temple-theme'),__('Logos, design preset and global colour system.','law-temple-theme')), 'typography'=>array('dashicons-editor-textcolor',__('Typography','law-temple-theme'),__('Heading, body, navigation, button and accent typography.','law-temple-theme')), 'layout'=>array('dashicons-layout',__('Layout','law-temple-theme'),__('Content widths, spacing, grids and structural dimensions.','law-temple-theme')), 'components'=>array('dashicons-screenoptions',__('Buttons & Cards','law-temple-theme'),__('Button variants, card appearance and interaction treatment.','law-temple-theme')), 'header'=>array('dashicons-menu-alt3',__('Header & Navigation','law-temple-theme'),__('Header layout, top bar, CTA, search and mega menu.','law-temple-theme')), 'hero'=>array('dashicons-format-image',__('Hero','law-temple-theme'),__('Global slider behaviour, heights and Hero Manager shortcut.','law-temple-theme')), 'homepage'=>array('dashicons-admin-home',__('Homepage','law-temple-theme'),__('Reorder sections, choose featured content and backgrounds.','law-temple-theme')), 'pages'=>array('dashicons-admin-page',__('Pages','law-temple-theme'),__('Set global defaults for standard WordPress page presentation.','law-temple-theme')), 'footer'=>array('dashicons-editor-insertmore',__('Footer','law-temple-theme'),__('Footer layout, columns, office, social and newsletter display.','law-temple-theme')), 'archives'=>array('dashicons-archive',__('Archives','law-temple-theme'),__('Archive headings, layouts, filters, columns and content display.','law-temple-theme')), 'profiles'=>array('dashicons-id',__('Profiles & Practice Pages','law-temple-theme'),__('Lawyer profile and Practice Area single-page builders.','law-temple-theme')), 'responsive'=>array('dashicons-smartphone',__('Responsive','law-temple-theme'),__('Tablet and mobile typography, spacing, grids and hero sizing.','law-temple-theme')), 'behaviour'=>array('dashicons-admin-generic',__('Behaviour & Utilities','law-temple-theme'),__('Breadcrumbs, search, animation, sharing, 404 and advanced scripts.','law-temple-theme')), 'tools'=>array('dashicons-database-export',__('Export / Import / Reset','law-temple-theme'),__('Backup, transfer or safely reset presentation settings.','law-temple-theme')), ); echo '<div class="lt-theme-overview-grid">'; foreach($cards as $slug=>$card){echo '<a class="lt-theme-overview-card" href="'.esc_url(lt_theme_options_admin_url($slug)).'"><span class="dashicons '.esc_attr($card[0]).'" aria-hidden="true"></span><strong>'.esc_html($card[1]).'</strong><p>'.esc_html($card[2]).'</p><span class="lt-theme-overview-card__link">'.esc_html__('Configure','law-temple-theme').' →</span></a>';} echo '</div>'; if(defined('LT_CORE_VERSION')){ echo '<hr><h2>'.esc_html__('Content management shortcuts','law-temple-theme').'</h2><p>'.esc_html__('Theme Options controls presentation. Use these content areas to edit the records shown by the theme.','law-temple-theme').'</p><div class="lt-theme-shortcuts">'; $shortcuts=array( admin_url('admin.php?page=lt-hero-manager')=>__('Hero Slides','law-temple-theme'), admin_url('edit.php?post_type=practice')=>__('Practice Areas','law-temple-theme'), admin_url('edit.php?post_type=lawyer')=>__('People','law-temple-theme'), admin_url('edit.php?post_type=insight')=>__('Insights','law-temple-theme'), admin_url('nav-menus.php')=>__('Menus','law-temple-theme'), admin_url('admin.php?page=lt-content-ordering')=>__('Content Ordering','law-temple-theme'), ); foreach($shortcuts as $url=>$label){echo '<a class="button" href="'.esc_url($url).'">'.esc_html($label).'</a> ';} echo '</div>'; } } elseif('branding'===$tab){ lt_theme_field('preset',__('Design preset','law-temple-theme'),'select',array('classic'=>'Law Temple Classic','modern'=>'Modern Counsel','executive'=>'Executive','editorial'=>'Editorial','international'=>'International')); echo '<div class="lt-preset-actions"><p>'.esc_html__('A preset applies a coordinated starting palette, typography, header/footer layout and spacing without changing site content.','law-temple-theme').'</p><a class="button" href="'.esc_url(lt_theme_preset_apply_url(lt_theme_option('preset','classic'))).'">'.esc_html__('Apply saved preset values','law-temple-theme').'</a></div>'; foreach(array('logo_primary'=>'Primary logo','logo_alt'=>'Alternative logo','logo_light'=>'Light logo','logo_dark'=>'Dark logo','logo_sticky'=>'Sticky-header logo','logo_mobile'=>'Mobile logo','logo_footer'=>'Footer logo','favicon'=>'Favicon / site icon fallback') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme'),'media'); foreach(array('primary'=>'Primary','secondary'=>'Secondary','accent'=>'Accent','gold'=>'Gold / highlight','heading'=>'Heading','text'=>'Body text','muted'=>'Muted text','link'=>'Links','link_hover'=>'Link hover','background'=>'Background','alternate'=>'Alternate background','dark'=>'Dark section','border'=>'Border','button'=>'Button','button_hover'=>'Button hover','header'=>'Header','header_text'=>'Header text','footer'=>'Footer','footer_text'=>'Footer text') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme'),'color'); lt_theme_field('logo_width',__('Desktop logo width','law-temple-theme'),'number');lt_theme_field('logo_height',__('Maximum logo height, 0 = automatic','law-temple-theme'),'number');lt_theme_field('logo_spacing',__('Logo spacing','law-temple-theme'),'number'); } elseif('typography'===$tab){ lt_theme_field('font_source',__('Font source','law-temple-theme'),'select',array('system'=>__('System / self-hosted stack','law-temple-theme'),'google'=>__('Optional Google Fonts','law-temple-theme')),__('Google Fonts are optional and disabled by default to reduce third-party requests.','law-temple-theme')); lt_theme_field('google_body_family',__('Google body font family','law-temple-theme'));lt_theme_field('google_heading_family',__('Google heading font family','law-temple-theme')); foreach(array('body_font'=>'Body font stack','heading_font'=>'Heading font stack','nav_font'=>'Navigation font stack','button_font'=>'Button font stack','accent_font'=>'Accent font stack') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme')); foreach(array('body_size'=>'Body size','body_weight'=>'Body weight','h1_size'=>'H1 size','h2_size'=>'H2 size','h3_size'=>'H3 size','h4_size'=>'H4 size','h5_size'=>'H5 size','h6_size'=>'H6 size','heading_weight'=>'Heading weight','nav_size'=>'Navigation size','nav_weight'=>'Navigation weight','button_size'=>'Button size','button_weight'=>'Button weight','accent_size'=>'Accent/label size','accent_weight'=>'Accent/label weight') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme'),'number'); foreach(array('body_line'=>'Body line height','body_letter'=>'Body letter spacing (px)','heading_line'=>'Heading line height','heading_letter'=>'Heading letter spacing (px)','nav_letter'=>'Navigation letter spacing (px)','button_letter'=>'Button letter spacing (px)','accent_letter'=>'Accent letter spacing (px)') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme')); foreach(array('heading_transform'=>'Heading text transform','nav_transform'=>'Navigation text transform','button_transform'=>'Button text transform','accent_transform'=>'Accent text transform') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme'),'select',array('none'=>__('None','law-temple-theme'),'uppercase'=>__('Uppercase','law-temple-theme'),'lowercase'=>__('Lowercase','law-temple-theme'),'capitalize'=>__('Capitalize','law-temple-theme'))); } elseif('layout'===$tab){ lt_theme_field('site_layout',__('Site layout','law-temple-theme'),'select',array('full'=>__('Full width','law-temple-theme'),'boxed'=>__('Boxed','law-temple-theme'))); foreach(array('site_width'=>'Maximum site width','content_width'=>'Content width','wide_width'=>'Wide content width','header_width'=>'Header width','section_y'=>'Section vertical spacing','section_x'=>'Section horizontal spacing','grid_gap'=>'Grid gap','card_padding'=>'Card padding','radius'=>'Global border radius','border_width'=>'Border width','button_radius'=>'Button radius','button_pad_y'=>'Button vertical padding','button_pad_x'=>'Button horizontal padding','sidebar_width'=>'Sidebar width') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme'),'number'); lt_theme_field('card_image_ratio',__('Card image ratio','law-temple-theme'));lt_theme_field('portrait_ratio',__('Portrait image ratio','law-temple-theme')); } elseif('components'===$tab){ foreach(array('button_primary_bg'=>'Primary button background','button_primary_text'=>'Primary button text','button_secondary_bg'=>'Secondary button background','button_secondary_text'=>'Secondary button text','button_gold_bg'=>'Gold button background','button_gold_text'=>'Gold button text','button_outline_color'=>'Outline button colour','button_dark_bg'=>'Dark button background','button_dark_text'=>'Dark button text','button_light_bg'=>'Light button background','button_light_text'=>'Light button text','card_background'=>'Card background','card_border'=>'Card border') as $k=>$l)lt_theme_field($k,__($l,'law-temple-theme'),'color'); lt_theme_field('button_hover_lift',__('Button hover lift in pixels','law-temple-theme'),'number');lt_theme_field('card_shadow',__('Card shadow','law-temple-theme'),'select',array('none'=>__('None','law-temple-theme'),'subtle'=>__('Subtle','law-temple-theme'),'medium'=>__('Medium','law-temple-theme')));lt_theme_field('card_hover',__('Card hover effect','law-temple-theme'),'select',array('none'=>__('None','law-temple-theme'),'border'=>__('Accent border','law-temple-theme'),'lift'=>__('Subtle lift','law-temple-theme'),'image'=>__('Image zoom','law-temple-theme')));lt_theme_field('card_image_visibility',__('Show card images when available','law-temple-theme'),'checkbox'); } elseif('header'===$tab){ if(function_exists('lt_theme_admin_header_preview'))lt_theme_admin_header_preview(); echo '<div class="lt-theme-context-callout"><div><h2>'.esc_html__('Header structure','law-temple-theme').'</h2><p>'.esc_html__('Configure the masthead here. Menu items themselves continue to use native WordPress Menus so content and presentation stay cleanly separated.','law-temple-theme').'</p></div><a class="button" href="'.esc_url(admin_url('nav-menus.php')).'">'.esc_html__('Manage Menus','law-temple-theme').'</a></div>'; echo '<h2>'.esc_html__('Header rendering source','law-temple-theme').'</h2><p>'.esc_html__('Keep the production PHP masthead or opt into a Gutenberg synced pattern for hybrid block-template editing. Announcement and top bars remain controlled below.','law-temple-theme').'</p>'; lt_theme_field('header_source',__('Header source','law-temple-theme'),'select',array('theme'=>__('Theme professional header','law-temple-theme'),'pattern'=>__('Synced Gutenberg pattern','law-temple-theme')));lt_theme_field('header_pattern_id',__('Header synced pattern','law-temple-theme'),'wp_block'); lt_theme_field('header_layout',__('Header layout','law-temple-theme'),'select',$layouts);lt_theme_field('sticky_header',__('Sticky header','law-temple-theme'),'checkbox');lt_theme_field('transparent_header',__('Transparent header on pages with hero','law-temple-theme'),'checkbox');lt_theme_field('header_height',__('Header height','law-temple-theme'),'number');lt_theme_field('header_cta_label',__('Header CTA text','law-temple-theme'));lt_theme_field('header_cta_url',__('Header CTA URL','law-temple-theme'),'url');lt_theme_field('show_home_menu_item',__('Show Home link in navigation','law-temple-theme'),'checkbox');lt_theme_field('show_search',__('Show search control','law-temple-theme'),'checkbox'); echo '<hr><h2>'.esc_html__('Top bar & announcement','law-temple-theme').'</h2>'; lt_theme_field('show_topbar',__('Show top bar','law-temple-theme'),'checkbox');lt_theme_field('topbar_text',__('Top bar text','law-temple-theme'));lt_theme_field('topbar_background',__('Top bar background','law-temple-theme'),'color');lt_theme_field('topbar_text_color',__('Top bar text colour','law-temple-theme'),'color');lt_theme_field('announcement',__('Announcement bar','law-temple-theme'),'checkbox');lt_theme_field('announcement_text',__('Announcement text','law-temple-theme'));lt_theme_field('announcement_url',__('Announcement URL','law-temple-theme'),'url');lt_theme_field('announcement_background',__('Announcement background','law-temple-theme'),'color');lt_theme_field('announcement_text_color',__('Announcement text colour','law-temple-theme'),'color'); echo '<hr><h2>'.esc_html__('Expertise mega menu','law-temple-theme').'</h2><p>'.esc_html__('The mega menu uses the native Primary Navigation and dynamically lists published Practice Areas and Sectors. It remains disabled on tablet/mobile navigation.','law-temple-theme').'</p>'; lt_theme_field('mega_menu',__('Enable professional expertise mega menu','law-temple-theme'),'checkbox');lt_theme_field('mega_menu_target',__('Mega menu target label','law-temple-theme'),'text',array(),__('Match the title of a top-level Primary Navigation item, normally Expertise.','law-temple-theme'));lt_theme_field('mega_menu_show_practices',__('Show Practice Areas in mega menu','law-temple-theme'),'checkbox');lt_theme_field('mega_menu_show_sectors',__('Show Sectors in mega menu','law-temple-theme'),'checkbox');lt_theme_field('mega_menu_practice_count',__('Practice Area links in mega menu','law-temple-theme'),'number');lt_theme_field('mega_menu_sector_count',__('Sector links in mega menu','law-temple-theme'),'number');lt_theme_field('mega_menu_practice_heading',__('Practice column heading','law-temple-theme'));lt_theme_field('mega_menu_sector_heading',__('Sector column heading','law-temple-theme'));lt_theme_field('mega_menu_cta_label',__('Mega menu CTA label','law-temple-theme'));lt_theme_field('mega_menu_cta_url',__('Mega menu CTA URL','law-temple-theme'),'url'); } elseif('hero'===$tab){ echo '<div class="lt-theme-context-callout"><div><h2>'.esc_html__('Global Hero Settings','law-temple-theme').'</h2><p>'.esc_html__('These settings control carousel behaviour across the theme. Individual slide content, layout, media, CTAs and scheduling are managed as Hero Slide content.','law-temple-theme').'</p></div>'; if(defined('LT_CORE_VERSION'))echo '<a class="button button-primary" href="'.esc_url(admin_url('admin.php?page=lt-hero-manager')).'">'.esc_html__('Open Hero Manager','law-temple-theme').'</a>'; echo '</div>'; lt_theme_field('hero_autoplay',__('Hero autoplay','law-temple-theme'),'checkbox');lt_theme_field('hero_duration',__('Hero duration (milliseconds)','law-temple-theme'),'number');lt_theme_field('hero_transition',__('Hero transition','law-temple-theme'),'select',array('fade'=>__('Fade','law-temple-theme'),'slide'=>__('Slide','law-temple-theme'),'crossfade'=>__('Crossfade','law-temple-theme')));lt_theme_field('hero_navigation',__('Hero navigation','law-temple-theme'),'select',array('dots-arrows'=>__('Dots + arrows','law-temple-theme'),'dots'=>__('Dots','law-temple-theme'),'arrows'=>__('Arrows','law-temple-theme'),'none'=>__('None','law-temple-theme')));lt_theme_field('hero_pause',__('Pause on hover/focus','law-temple-theme'),'checkbox');lt_theme_field('hero_loop',__('Loop slides','law-temple-theme'),'checkbox');lt_theme_field('hero_desktop_height',__('Desktop hero height','law-temple-theme'),'number'); } elseif('pages'===$tab){ if(defined('LT_CORE_VERSION')) echo '<div class="notice notice-info inline"><p><strong>'.esc_html__('Building internal pages?','law-temple-theme').'</strong> '.esc_html__('Use Law Firm → Page Builder for full-page patterns and drag-and-drop Law Firm blocks. Select Builder Canvas for edge-to-edge block layouts.','law-temple-theme').' <a href="'.esc_url(admin_url('admin.php?page=lt-page-builder')).'">'.esc_html__('Open Page Builder','law-temple-theme').'</a></p></div>'; echo '<h2>'.esc_html__('Global page defaults','law-temple-theme').'</h2><p>'.esc_html__('These values apply when an individual page is set to Default or Inherit. Page-specific exceptions remain available in the Law Firm Page Options panel on the page edit screen.','law-temple-theme').'</p>'; lt_theme_field('page_default_hero_layout',__('Default page hero','law-temple-theme'),'select',array('none'=>__('None','law-temple-theme'),'minimal'=>__('Minimal','law-temple-theme'),'image'=>__('Image background','law-temple-theme'),'split'=>__('Split image / text','law-temple-theme'))); lt_theme_field('page_default_layout',__('Default page layout','law-temple-theme'),'select',array('full'=>__('Full width','law-temple-theme'),'builder'=>__('Builder Canvas','law-temple-theme'),'sidebar'=>__('Sidebar','law-temple-theme'))); lt_theme_field('page_default_breadcrumbs',__('Default breadcrumbs','law-temple-theme'),'select',array('inherit'=>__('Use global breadcrumb setting','law-temple-theme'),'show'=>__('Show','law-temple-theme'),'hide'=>__('Hide','law-temple-theme'))); lt_theme_field('page_default_header_style',__('Default page header style','law-temple-theme'),'select',array('standard'=>__('Standard','law-temple-theme'),'transparent'=>__('Transparent','law-temple-theme'),'dark'=>__('Dark','law-temple-theme'))); lt_theme_field('page_default_footer_style',__('Default page footer style','law-temple-theme'),'select',array('standard'=>__('Standard','law-temple-theme'),'minimal'=>__('Minimal','law-temple-theme'),'dark'=>__('Dark','law-temple-theme'))); lt_theme_field('page_default_cta',__('Default page CTA behaviour','law-temple-theme'),'select',array('inherit'=>__('Show configured global CTA when available','law-temple-theme'),'show'=>__('Show','law-temple-theme'),'hide'=>__('Hide','law-temple-theme'))); echo '<div class="lt-theme-context-callout"><div><h2>'.esc_html__('Per-page overrides','law-temple-theme').'</h2><p>'.esc_html__('Edit any WordPress page to override the hero, image, heading, breadcrumbs, page width, header/footer style and CTA for that page only.','law-temple-theme').'</p></div><a class="button" href="'.esc_url(admin_url('edit.php?post_type=page')).'">'.esc_html__('Manage Pages','law-temple-theme').'</a></div>'; } elseif('footer'===$tab){ echo '<h2>'.esc_html__('Footer rendering source','law-temple-theme').'</h2><p>'.esc_html__('Use the professional theme footer or choose a published synced Gutenberg pattern as the complete footer structure.','law-temple-theme').'</p>'; lt_theme_field('footer_source',__('Footer source','law-temple-theme'),'select',array('theme'=>__('Theme professional footer','law-temple-theme'),'pattern'=>__('Synced Gutenberg pattern','law-temple-theme')));lt_theme_field('footer_pattern_id',__('Footer synced pattern','law-temple-theme'),'wp_block'); if(function_exists('lt_theme_admin_footer_preview'))lt_theme_admin_footer_preview(); echo '<div class="lt-theme-context-callout"><div><h2>'.esc_html__('Footer presentation','law-temple-theme').'</h2><p>'.esc_html__('Footer layout and visibility settings are controlled here. Footer and Legal menu items remain managed through native WordPress Menus.','law-temple-theme').'</p></div><a class="button" href="'.esc_url(admin_url('nav-menus.php')).'">'.esc_html__('Manage Footer Menus','law-temple-theme').'</a></div>'; lt_theme_field('footer_layout',__('Footer layout','law-temple-theme'),'select',array('columns'=>__('Professional columns','law-temple-theme'),'minimal'=>__('Minimal','law-temple-theme'),'editorial'=>__('Editorial','law-temple-theme')));lt_theme_field('footer_description',__('Firm footer description','law-temple-theme'),'textarea');lt_theme_field('footer_columns',__('Footer columns','law-temple-theme'),'number');lt_theme_field('footer_show_practices',__('Show Practice Areas','law-temple-theme'),'checkbox');lt_theme_field('footer_show_insights',__('Show latest Insights','law-temple-theme'),'checkbox');lt_theme_field('footer_show_social',__('Show social links','law-temple-theme'),'checkbox');lt_theme_field('footer_show_regulatory',__('Show registration/regulatory information','law-temple-theme'),'checkbox');lt_theme_field('footer_show_office',__('Show main office details','law-temple-theme'),'checkbox');lt_theme_field('newsletter_shortcode',__('Newsletter shortcode / block integration','law-temple-theme')); } elseif('homepage'===$tab){ lt_theme_section_manager('home_order','home_disabled',array('hero'=>__('Hero','law-temple-theme'),'intro'=>__('Firm introduction','law-temple-theme'),'practices'=>__('Practice Areas','law-temple-theme'),'sectors'=>__('Sectors','law-temple-theme'),'people'=>__('People','law-temple-theme'),'values'=>__('Values / Why choose us','law-temple-theme'),'matters'=>__('Representative matters','law-temple-theme'),'testimonials'=>__('Testimonials','law-temple-theme'),'awards'=>__('Awards','law-temple-theme'),'insights'=>__('Insights','law-temple-theme'),'offices'=>__('Offices','law-temple-theme'),'careers'=>__('Careers','law-temple-theme'),'faq'=>__('FAQ','law-temple-theme'),'custom'=>__('Homepage Gutenberg content','law-temple-theme'),'contact'=>__('Contact CTA','law-temple-theme'))); lt_theme_field('intro_heading',__('Firm introduction heading','law-temple-theme'));lt_theme_field('intro_text',__('Firm introduction text override','law-temple-theme'),'textarea');lt_theme_field('values_heading',__('Values heading','law-temple-theme'));lt_theme_field('values_items',__('Values','law-temple-theme'),'textarea',array(),__('One item per line as Title|Description.','law-temple-theme')); foreach(array('practice'=>'home_practice_ids','lawyer'=>'home_lawyer_ids','insight'=>'home_insight_ids') as $pt=>$key){if(function_exists('lt_theme_post_multiselect_field'))lt_theme_post_multiselect_field($key,sprintf(__('Selected %s','law-temple-theme'),$pt),$pt);} lt_theme_field('home_practice_count',__('Practice count','law-temple-theme'),'number');lt_theme_field('home_people_count',__('People count','law-temple-theme'),'number');lt_theme_field('home_insight_count',__('Insight count','law-temple-theme'),'number'); if(post_type_exists('lt_cta')){$items=get_posts(array('post_type'=>'lt_cta','posts_per_page'=>-1,'post_status'=>array('publish','draft'),'orderby'=>'title','order'=>'ASC'));$choices=array(0=>__('None','law-temple-theme'));foreach($items as $i)$choices[$i->ID]=$i->post_title;lt_theme_field('global_cta_id',__('Reusable global CTA','law-temple-theme'),'select',$choices);} lt_theme_home_background_fields(); } elseif('profiles'===$tab){ echo '<h2>'.esc_html__('Lawyer profile builder','law-temple-theme').'</h2><p>'.esc_html__('Choose the global professional-profile structure and drag sections into the preferred order. Empty sections are hidden automatically.','law-temple-theme').'</p>'; lt_theme_field('profile_layout',__('Profile layout','law-temple-theme'),'select',array('split'=>__('Split portrait + biography','law-temple-theme'),'editorial'=>__('Editorial','law-temple-theme'),'contact-rail'=>__('Contact rail','law-temple-theme')));lt_theme_field('profile_nav_sticky',__('Sticky profile section navigation','law-temple-theme'),'checkbox');lt_theme_field('profile_show_photo',__('Show profile photograph','law-temple-theme'),'checkbox');lt_theme_field('profile_contact_rail',__('Show persistent contact rail','law-temple-theme'),'checkbox');lt_theme_field('profile_content_width',__('Profile content width','law-temple-theme'),'select',array('narrow'=>__('Narrow editorial','law-temple-theme'),'standard'=>__('Standard','law-temple-theme'),'wide'=>__('Wide','law-temple-theme'))); if(function_exists('lt_theme_profile_builder_preview'))lt_theme_profile_builder_preview(); lt_theme_section_manager('profile_order','profile_disabled',array('biography'=>__('Biography','law-temple-theme'),'practice'=>__('Practice Areas','law-temple-theme'),'sector'=>__('Sectors','law-temple-theme'),'experience'=>__('Experience','law-temple-theme'),'qualifications'=>__('Qualifications','law-temple-theme'),'education'=>__('Education','law-temple-theme'),'bar'=>__('Bar admissions','law-temple-theme'),'memberships'=>__('Memberships','law-temple-theme'),'languages'=>__('Languages','law-temple-theme'),'matters'=>__('Representative matters','law-temple-theme'),'awards'=>__('Awards','law-temple-theme'),'publications'=>__('Publications','law-temple-theme'),'insights'=>__('Insights','law-temple-theme'),'downloads'=>__('Downloads','law-temple-theme'),'contact'=>__('Contact','law-temple-theme'))); echo '<hr><h2>'.esc_html__('Practice Area page builder','law-temple-theme').'</h2><p>'.esc_html__('Control the default Practice Area single-page structure while keeping all services, lawyers, sectors, matters, insights and FAQs as reusable content relationships.','law-temple-theme').'</p>'; lt_theme_field('practice_single_layout',__('Practice page layout','law-temple-theme'),'select',array('editorial'=>__('Editorial','law-temple-theme'),'split'=>__('Split hero','law-temple-theme'),'sidebar'=>__('Sticky summary rail','law-temple-theme')));lt_theme_field('practice_show_image',__('Show Practice Area image','law-temple-theme'),'checkbox');lt_theme_field('practice_sticky_summary',__('Sticky Practice Area summary','law-temple-theme'),'checkbox');lt_theme_field('practice_content_width',__('Practice content width','law-temple-theme'),'select',array('narrow'=>__('Narrow editorial','law-temple-theme'),'standard'=>__('Standard','law-temple-theme'),'wide'=>__('Wide','law-temple-theme'))); if(function_exists('lt_theme_practice_builder_preview'))lt_theme_practice_builder_preview(); lt_theme_section_manager('practice_order','practice_disabled',array('overview'=>__('Overview','law-temple-theme'),'services'=>__('Services','law-temple-theme'),'capabilities'=>__('Capabilities','law-temple-theme'),'sectors'=>__('Sectors','law-temple-theme'),'lawyers'=>__('Lawyers / People','law-temple-theme'),'matters'=>__('Representative matters','law-temple-theme'),'awards'=>__('Awards','law-temple-theme'),'insights'=>__('Insights','law-temple-theme'),'faq'=>__('FAQ','law-temple-theme'),'contact'=>__('Contact CTA','law-temple-theme'))); } elseif('archives'===$tab){ echo '<h2>'.esc_html__('Archive presentation','law-temple-theme').'</h2><p>'.esc_html__('Set the shared professional archive hero, filters, image/excerpt visibility and responsive column defaults. Individual content-type layouts are configured below.','law-temple-theme').'</p>'; lt_theme_field('archive_hero_style',__('Archive hero style','law-temple-theme'),'select',array('minimal'=>__('Minimal','law-temple-theme'),'surface'=>__('Warm surface','law-temple-theme'),'dark'=>__('Dark professional','law-temple-theme')));lt_theme_field('archive_show_filters',__('Show archive filters','law-temple-theme'),'checkbox');lt_theme_field('archive_show_images',__('Show archive images','law-temple-theme'),'checkbox');lt_theme_field('archive_show_excerpts',__('Show archive excerpts','law-temple-theme'),'checkbox');lt_theme_field('archive_columns',__('Desktop archive columns','law-temple-theme'),'number');lt_theme_field('archive_per_page',__('Items per page','law-temple-theme'),'number'); if(function_exists('lt_theme_archive_builder_preview'))lt_theme_archive_builder_preview(); echo '<hr><h2>'.esc_html__('Archive headings & layouts','law-temple-theme').'</h2>'; lt_theme_field('practice_archive_heading',__('Practice archive heading','law-temple-theme'));lt_theme_field('practice_archive_intro',__('Practice archive introduction','law-temple-theme'),'textarea');lt_theme_field('people_archive_heading',__('People archive heading','law-temple-theme'));lt_theme_field('people_archive_intro',__('People archive introduction','law-temple-theme'),'textarea');lt_theme_field('insight_archive_heading',__('Insights archive heading','law-temple-theme'));lt_theme_field('insight_archive_intro',__('Insights archive introduction','law-temple-theme'),'textarea');lt_theme_field('matter_archive_heading',__('Experience archive heading','law-temple-theme'));lt_theme_field('matter_archive_intro',__('Experience archive introduction','law-temple-theme'),'textarea');lt_theme_field('office_archive_heading',__('Offices archive heading','law-temple-theme'));lt_theme_field('office_archive_intro',__('Offices archive introduction','law-temple-theme'),'textarea');lt_theme_field('career_archive_heading',__('Careers archive heading','law-temple-theme'));lt_theme_field('career_archive_intro',__('Careers archive introduction','law-temple-theme'),'textarea');lt_theme_field('testimonial_archive_heading',__('Testimonials archive heading','law-temple-theme'));lt_theme_field('testimonial_archive_intro',__('Testimonials archive introduction','law-temple-theme'),'textarea');lt_theme_field('award_archive_heading',__('Awards archive heading','law-temple-theme'));lt_theme_field('award_archive_intro',__('Awards archive introduction','law-temple-theme'),'textarea'); lt_theme_field('practice_archive_layout',__('Practice archive layout','law-temple-theme'),'select',array('numbered'=>'Numbered list','cards'=>'Cards','image-cards'=>'Image cards','accordion'=>'Accordion','two-column'=>'Two-column list','three-column'=>'Three-column grid','four-column'=>'Four-column grid'));lt_theme_field('lawyer_archive_layout',__('People archive layout','law-temple-theme'),'select',array('portrait'=>'Portrait grid','compact'=>'Compact grid','list'=>'List','directory'=>'Directory','partners'=>'Featured partners'));lt_theme_field('insight_archive_layout',__('Insight archive layout','law-temple-theme'),'select',array('grid'=>'Grid','list'=>'List','editorial'=>'Editorial')); foreach(array('matter'=>'Representative Matters','office'=>'Offices','career'=>'Careers','testimonial'=>'Testimonials','award'=>'Awards') as $type=>$label){lt_theme_field($type.'_archive_layout',sprintf(__('%s archive layout','law-temple-theme'),$label),'select',array('grid'=>__('Grid','law-temple-theme'),'list'=>__('List','law-temple-theme'),'editorial'=>__('Editorial','law-temple-theme'),'quotes'=>__('Quote layout','law-temple-theme')));lt_theme_field($type.'_archive_columns',sprintf(__('%s columns','law-temple-theme'),$label),'number');} } elseif('responsive'===$tab){ echo '<h2>'.esc_html__('Tablet presentation','law-temple-theme').'</h2><p>'.esc_html__('Fine-tune key scale and spacing values for tablets without changing the desktop design system.','law-temple-theme').'</p>'; lt_theme_field('tablet_h1',__('Tablet H1 size','law-temple-theme'),'number');lt_theme_field('tablet_h2',__('Tablet H2 size','law-temple-theme'),'number');lt_theme_field('tablet_body',__('Tablet body size','law-temple-theme'),'number');lt_theme_field('tablet_section_y',__('Tablet section spacing','law-temple-theme'),'number');lt_theme_field('tablet_grid_gap',__('Tablet grid gap','law-temple-theme'),'number');lt_theme_field('hero_tablet_height',__('Tablet hero height','law-temple-theme'),'number');lt_theme_field('archive_columns_tablet',__('Tablet archive columns','law-temple-theme'),'number');lt_theme_field('tablet_gutter',__('Tablet horizontal gutter','law-temple-theme'),'number'); echo '<hr><h2>'.esc_html__('Mobile presentation','law-temple-theme').'</h2><p>'.esc_html__('Mobile controls are deliberately limited to high-value settings so administrators can customize safely without breaking layout integrity.','law-temple-theme').'</p>'; lt_theme_field('mobile_h1',__('Mobile H1 size','law-temple-theme'),'number');lt_theme_field('mobile_h2',__('Mobile H2 size','law-temple-theme'),'number');lt_theme_field('mobile_body',__('Mobile body size','law-temple-theme'),'number');lt_theme_field('mobile_section_y',__('Mobile section spacing','law-temple-theme'),'number');lt_theme_field('mobile_grid_gap',__('Mobile grid gap','law-temple-theme'),'number');lt_theme_field('mobile_gutter',__('Mobile horizontal gutter','law-temple-theme'),'number');lt_theme_field('hero_mobile_height',__('Mobile hero height','law-temple-theme'),'number');lt_theme_field('mobile_hero_media_height',__('Mobile hero image height','law-temple-theme'),'number');lt_theme_field('mobile_hero_media_position',__('Mobile hero image position','law-temple-theme'),'select',array('below'=>__('Below text','law-temple-theme'),'above'=>__('Above text','law-temple-theme')));lt_theme_field('mobile_hero_hide_media',__('Hide hero image/video on mobile','law-temple-theme'),'checkbox');lt_theme_field('mobile_hero_stack_buttons',__('Stack hero buttons on mobile','law-temple-theme'),'checkbox');lt_theme_field('archive_columns_mobile',__('Mobile archive columns','law-temple-theme'),'number');lt_theme_field('logo_mobile_width',__('Mobile logo width','law-temple-theme'),'number');lt_theme_field('mobile_menu_layout',__('Mobile menu layout','law-temple-theme'),'select',array('drawer'=>__('Drawer','law-temple-theme'),'overlay'=>__('Full overlay','law-temple-theme'),'dropdown'=>__('Dropdown','law-temple-theme')));lt_theme_field('mobile_drawer_width',__('Mobile drawer width (%)','law-temple-theme'),'number');lt_theme_field('mobile_sticky_header',__('Keep header sticky on mobile','law-temple-theme'),'checkbox');lt_theme_field('mobile_show_header_cta',__('Show header CTA on mobile','law-temple-theme'),'checkbox');lt_theme_field('mobile_show_topbar',__('Show top bar on mobile','law-temple-theme'),'checkbox');lt_theme_field('mobile_show_announcement',__('Show announcement on mobile','law-temple-theme'),'checkbox');lt_theme_field('mobile_breadcrumbs',__('Show breadcrumbs on mobile','law-temple-theme'),'checkbox');lt_theme_field('mobile_profile_nav',__('Profile navigation on mobile','law-temple-theme'),'select',array('scroll'=>__('Horizontal scroll','law-temple-theme'),'wrap'=>__('Wrap','law-temple-theme'),'hide'=>__('Hide','law-temple-theme')));lt_theme_field('mobile_filters_layout',__('Archive filters on mobile','law-temple-theme'),'select',array('stack'=>__('Stack fields','law-temple-theme'),'wrap'=>__('Wrap fields','law-temple-theme')));lt_theme_field('mobile_footer_align',__('Mobile footer alignment','law-temple-theme'),'select',array('left'=>__('Left','law-temple-theme'),'center'=>__('Centre','law-temple-theme'))); } elseif('behaviour'===$tab){ lt_theme_field('breadcrumbs',__('Breadcrumbs','law-temple-theme'),'checkbox');lt_theme_field('404_heading',__('404 heading','law-temple-theme'));lt_theme_field('404_message',__('404 message','law-temple-theme'),'textarea');lt_theme_field('404_show_search',__('Show search on 404','law-temple-theme'),'checkbox');lt_theme_field('404_show_practices',__('Show Practice Areas on 404','law-temple-theme'),'checkbox');lt_theme_field('404_cta_label',__('404 CTA label','law-temple-theme'));lt_theme_field('404_cta_url',__('404 CTA URL','law-temple-theme'),'url');lt_theme_field('breadcrumb_home',__('Breadcrumb home label','law-temple-theme'));lt_theme_field('breadcrumb_separator',__('Breadcrumb separator','law-temple-theme'));lt_theme_field('animations',__('Subtle animations','law-temple-theme'),'checkbox');lt_theme_field('live_search',__('Live filtering/search','law-temple-theme'),'checkbox');lt_theme_field('search_suggestions',__('Live search suggestions','law-temple-theme'),'number');lt_theme_field('print_styles',__('Print styles','law-temple-theme'),'checkbox');lt_theme_field('social_sharing',__('Insight social sharing','law-temple-theme'),'checkbox');if(current_user_can('unfiltered_html')){lt_theme_field('custom_header_scripts',__('Custom header scripts','law-temple-theme'),'textarea');lt_theme_field('custom_footer_scripts',__('Custom footer scripts','law-temple-theme'),'textarea');} } elseif('tools'===$tab){ $payload=array('_meta'=>array('product'=>'Law Firm Theme','version'=>LT_THEME_VERSION,'exported_at'=>gmdate('c')),'settings'=>lt_theme_options()); $json=wp_json_encode($payload,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); echo '<h2>'.esc_html__('Export settings','law-temple-theme').'</h2><p><a class="button button-primary" href="'.esc_url(wp_nonce_url(admin_url('admin-post.php?action=lt_theme_export_settings'),'lt_theme_export_settings')).'">'.esc_html__('Download settings JSON','law-temple-theme').'</a></p><textarea readonly rows="12" class="large-text code">'.esc_textarea($json).'</textarea>'; echo '<h2>'.esc_html__('Import settings','law-temple-theme').'</h2><form method="post">';wp_nonce_field('lt_theme_tools','lt_theme_tools_nonce');echo '<textarea name="lt_import_json" rows="10" class="large-text code"></textarea><p><button class="button button-primary" name="lt_theme_import" value="1">'.esc_html__('Import settings','law-temple-theme').'</button></p>'; echo '<hr><h2>'.esc_html__('Restore last backup','law-temple-theme').'</h2>'; if(get_option('lt_theme_options_backup'))echo '<p><button class="button" name="lt_theme_restore" value="1">'.esc_html__('Restore previous settings','law-temple-theme').'</button></p>';else echo '<p>'.esc_html__('No settings backup is available yet.','law-temple-theme').'</p>'; echo '<hr><h2>'.esc_html__('Reset design configuration','law-temple-theme').'</h2><p>'.esc_html__('This resets presentation only. It never deletes lawyers, practices, insights or other content.','law-temple-theme').'</p><button class="button" name="lt_theme_reset" value="1" onclick="return confirm(\''.esc_js(__('Reset design settings?','law-temple-theme')).'\')">'.esc_html__('Reset design settings','law-temple-theme').'</button>'; echo '<hr><h2>'.esc_html__('Reset one section','law-temple-theme').'</h2><select name="lt_reset_group"><option value="branding">Branding & Colours</option><option value="typography">Typography</option><option value="layout">Layout</option><option value="components">Buttons & Cards</option><option value="header">Header & Navigation</option><option value="hero">Hero</option><option value="homepage">Homepage</option><option value="pages">Pages</option><option value="footer">Footer</option><option value="archives">Archives</option><option value="profiles">Profiles & Practice Pages</option><option value="responsive">Responsive</option><option value="behaviour">Behaviour & Utilities</option></select> <button class="button" name="lt_theme_reset_group" value="1">'.esc_html__('Reset selected section','law-temple-theme').'</button></form>'; } } function lt_theme_reset_groups(){ return array( 'branding'=>array('preset','logo_primary','logo_alt','logo_light','logo_dark','logo_sticky','logo_mobile','logo_footer','favicon','logo_width','logo_height','logo_spacing','primary','secondary','accent','gold','heading','text','muted','link','link_hover','background','alternate','dark','border','button','button_hover','header','header_text','footer','footer_text'), 'typography'=>array('font_source','google_body_family','google_heading_family','body_font','heading_font','nav_font','button_font','accent_font','body_size','body_line','body_letter','body_weight','h1_size','h2_size','h3_size','h4_size','h5_size','h6_size','heading_weight','heading_line','heading_letter','heading_transform','nav_size','nav_weight','nav_letter','nav_transform','button_size','button_weight','button_letter','button_transform','accent_size','accent_weight','accent_letter','accent_transform'), 'layout'=>array('site_layout','site_width','content_width','wide_width','header_width','section_y','section_x','grid_gap','card_padding','radius','border_width','button_radius','button_pad_y','button_pad_x','sidebar_width','card_image_ratio','portrait_ratio'), 'components'=>array('button_primary_bg','button_primary_text','button_secondary_bg','button_secondary_text','button_gold_bg','button_gold_text','button_outline_color','button_dark_bg','button_dark_text','button_light_bg','button_light_text','button_hover_lift','card_background','card_border','card_shadow','card_hover','card_image_visibility'), 'header'=>array('header_source','header_pattern_id','header_layout','sticky_header','transparent_header','header_height','header_cta_label','header_cta_url','show_home_menu_item','show_search','show_topbar','topbar_text','topbar_background','topbar_text_color','announcement','announcement_text','announcement_url','announcement_background','announcement_text_color','mega_menu','mega_menu_target','mega_menu_show_practices','mega_menu_show_sectors','mega_menu_practice_count','mega_menu_sector_count','mega_menu_practice_heading','mega_menu_sector_heading','mega_menu_cta_label','mega_menu_cta_url'), 'hero'=>array('hero_autoplay','hero_duration','hero_transition','hero_navigation','hero_pause','hero_loop','hero_desktop_height'), 'footer'=>array('footer_source','footer_pattern_id','footer_layout','footer_description','footer_columns','footer_show_practices','footer_show_insights','footer_show_social','footer_show_regulatory','footer_show_office','newsletter_shortcode'), 'pages'=>array('page_default_hero_layout','page_default_layout','page_default_breadcrumbs','page_default_header_style','page_default_footer_style','page_default_cta'), 'homepage'=>array('home_order','home_disabled','home_practice_ids','home_lawyer_ids','home_insight_ids','home_practice_count','home_people_count','home_insight_count','global_cta_id','intro_heading','intro_text','values_heading','values_items','home_intro_bg','home_practices_bg','home_sectors_bg','home_people_bg','home_values_bg','home_matters_bg','home_testimonials_bg','home_awards_bg','home_insights_bg','home_offices_bg','home_careers_bg','home_faq_bg','home_contact_bg'), 'archives'=>array('archive_hero_style','archive_show_filters','archive_show_images','archive_show_excerpts','archive_columns','archive_per_page','practice_archive_heading','practice_archive_intro','people_archive_heading','people_archive_intro','insight_archive_heading','insight_archive_intro','matter_archive_heading','matter_archive_intro','office_archive_heading','office_archive_intro','career_archive_heading','career_archive_intro','testimonial_archive_heading','testimonial_archive_intro','award_archive_heading','award_archive_intro','practice_archive_layout','lawyer_archive_layout','insight_archive_layout','matter_archive_layout','office_archive_layout','career_archive_layout','testimonial_archive_layout','award_archive_layout','matter_archive_columns','office_archive_columns','career_archive_columns','testimonial_archive_columns','award_archive_columns'), 'profiles'=>array('profile_layout','profile_nav_sticky','profile_show_photo','profile_contact_rail','profile_content_width','profile_order','profile_disabled','practice_single_layout','practice_show_image','practice_sticky_summary','practice_content_width','practice_order','practice_disabled'), 'responsive'=>array('tablet_h1','tablet_h2','tablet_body','tablet_section_y','tablet_grid_gap','tablet_gutter','hero_tablet_height','archive_columns_tablet','mobile_h1','mobile_h2','mobile_body','mobile_section_y','mobile_grid_gap','mobile_gutter','hero_mobile_height','mobile_hero_media_height','mobile_hero_media_position','mobile_hero_hide_media','mobile_hero_stack_buttons','archive_columns_mobile','logo_mobile_width','mobile_menu_layout','mobile_drawer_width','mobile_sticky_header','mobile_show_header_cta','mobile_show_topbar','mobile_show_announcement','mobile_breadcrumbs','mobile_profile_nav','mobile_filters_layout','mobile_footer_align'), 'behaviour'=>array('404_heading','404_message','404_show_search','404_show_practices','404_cta_label','404_cta_url','breadcrumbs','breadcrumb_home','breadcrumb_separator','animations','live_search','print_styles','social_sharing','search_suggestions','custom_header_scripts','custom_footer_scripts'), ); } function lt_theme_handle_tools(){ if(empty($_POST['lt_theme_tools_nonce'])||!wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['lt_theme_tools_nonce'])),'lt_theme_tools')||!current_user_can('edit_theme_options'))return; if(isset($_POST['lt_theme_reset'])){update_option('lt_theme_options_backup',lt_theme_options(),false);update_option('lt_theme_options_v3',lt_theme_defaults());} if(isset($_POST['lt_theme_import'])){$raw=wp_unslash($_POST['lt_import_json']??'');$data=json_decode($raw,true);if(isset($data['settings'])&&is_array($data['settings']))$data=$data['settings'];if(is_array($data)){update_option('lt_theme_options_backup',lt_theme_options(),false);update_option('lt_theme_options_v3',lt_theme_sanitize_options($data));}} if(isset($_POST['lt_theme_restore'])){$backup=get_option('lt_theme_options_backup');if(is_array($backup))update_option('lt_theme_options_v3',lt_theme_sanitize_options($backup));} if(isset($_POST['lt_theme_reset_group'])){$group=sanitize_key($_POST['lt_reset_group']??'');$groups=lt_theme_reset_groups();if(isset($groups[$group])){update_option('lt_theme_options_backup',lt_theme_options(),false);$current=lt_theme_options();$defaults=lt_theme_defaults();foreach($groups[$group] as $key)$current[$key]=$defaults[$key]??'';update_option('lt_theme_options_v3',$current);}} } function lt_theme_export_settings(){ if(!current_user_can('edit_theme_options')||!check_admin_referer('lt_theme_export_settings'))wp_die(esc_html__('You are not allowed to export these settings.','law-temple-theme')); $payload=array('_meta'=>array('product'=>'Law Firm Theme','version'=>LT_THEME_VERSION,'exported_at'=>gmdate('c')),'settings'=>lt_theme_options()); nocache_headers();header('Content-Type: application/json; charset=utf-8');header('Content-Disposition: attachment; filename="law-firm-theme-settings-'.gmdate('Y-m-d').'.json"');echo wp_json_encode($payload,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);exit; } add_action('admin_post_lt_theme_export_settings','lt_theme_export_settings');
Save
Cancel