'; } // Callback function for the 'Tablet Breakpoint' field function lcp_tablet_breakpoint_field() { $options = get_option('lcp_theme_settings'); $tablet_breakpoint = isset($options['tablet_breakpoint']) ? $options['tablet_breakpoint'] : 1024; echo ''; } function lcp_theme_settings_sanitize($input) { // Sanitize mobile breakpoint $input['mobile_breakpoint'] = isset($input['mobile_breakpoint']) ? absint($input['mobile_breakpoint']) : 768; // Sanitize tablet breakpoint $input['tablet_breakpoint'] = isset($input['tablet_breakpoint']) ? absint($input['tablet_breakpoint']) : 1024; return $input; } // Function to output the checkbox for 'Enable Key Points Meta' function lcp_enable_key_points_meta_field() { // Retrieve current value for 'enable_key_points_meta' $options = get_option( 'lcp_theme_settings', array() ); $checked = isset( $options['enable_key_points_meta'] ) ? $options['enable_key_points_meta'] : false; // Output the checkbox echo ''; } function lcp_enable_highlight_to_share() { // Retrieve current value for 'enable_highlight_to_share' $options = get_option( 'lcp_theme_settings', array() ); $checked = isset( $options['enable_highlight_to_share'] ) ? $options['enable_highlight_to_share'] : false; // Output the checkbox echo ''; } // The callback function to display the custom code inserterpage content // Register a custom code setting in wp_options to store the custom code snippets function lcp_custom_code_settings_init() { register_setting( 'custom_code_group', 'custom_code_options', 'sanitize_custom_code' ); } add_action( 'admin_init', 'lcp_custom_code_settings_init' ); // Sanitize the custom code input before saving it function sanitize_custom_code( $input ) { // Sanitize each field if ( isset( $input['js_header'] ) ) { $input['js_header'] = sanitize_textarea_field( $input['js_header'] ); } if ( isset( $input['js_footer'] ) ) { $input['js_footer'] = sanitize_textarea_field( $input['js_footer'] ); } if ( isset( $input['css_header'] ) ) { $input['css_header'] = sanitize_textarea_field( $input['css_header'] ); } if ( isset( $input['css_footer'] ) ) { $input['css_footer'] = sanitize_textarea_field( $input['css_footer'] ); } return $input; } function lcp_custom_code_output($hook) { // Disable the custom code inserter if wp_env is set if (defined('LCP_DISABLE_CODE_INSERTER') && LCP_DISABLE_CODE_INSERTER === true) { // Retrieve the custom code options $custom_code = get_option( 'custom_code_options', array() ); // Prevent execution in the admin area if ( is_admin() ) return; // Check if the hook is for the header if ($hook == "header") { // Check and output JS for header if ( isset( $custom_code['js_header'] ) && ! empty( $custom_code['js_header'] ) ) { echo ''; } // Check and output CSS for header if ( isset( $custom_code['css_header'] ) && ! empty( $custom_code['css_header'] ) ) { echo ''; } } // Check if the hook is for the footer if ($hook == "footer") { // Check and output JS for footer if ( isset( $custom_code['js_footer'] ) && ! empty( $custom_code['js_footer'] ) ) { echo ''; } } } } // Attach to wp_head and wp_footer, passing the location as a parameter add_action( 'wp_head', function() { lcp_custom_code_output('header'); }); add_action( 'wp_footer', function() { lcp_custom_code_output('footer'); }); // Register the settings page with tabs function render_lcp_theme_settings_page() { ?>

Theme Settings

Custom SVG Icons

Custom Code Settings

CSS
JavaScript in Header
JavaScript in Footer

Image Sizes

Miscellaneous Settings

Demo Posts

' . count($demo_posts_data['post_ids']) . ' Demo posts have been imported.'; // If demo posts have been imported, display the "Delete Demo Posts" button (this can be disabled or hidden based on your logic) echo ''; } else { // If demo posts have NOT been imported, display the "Import Demo Posts" button echo ''; } ?>

Hey there! Share this:

Facebook | Twitter/X "; }