';
}
// 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;
}
// Inject breakpoints to frontned
function lcp_inject_breakpoints_to_frontend() {
// Get the breakpoints from the settings
$options = get_option('lcp_theme_settings');
$mobile_breakpoint = isset($options['mobile_breakpoint']) ? $options['mobile_breakpoint'] : 768;
$tablet_breakpoint = isset($options['tablet_breakpoint']) ? $options['tablet_breakpoint'] : 1024;
// Inject the CSS variables into the head of the document
echo "";
}
add_action('wp_head', 'lcp_inject_breakpoints_to_frontend');
// 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 '';
}
// The callback function to display the custom code inserterpage content
function lcp_custom_code_inserter_page() {
// Get the stored options from wp_options
$custom_code = get_option( 'custom_code_options', array() );
?>
Custom Code Settings
' . $custom_code['js_header'] . '';
}
// 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');
});
function render_lcp_theme_settings_page() {
?>