Configure your accessibility sidebar
'radio',
'id' => 'font_size_changer',
'vals' => array('true' => 'Enable', 'false' => 'Disable')
);
add_settings_field('font_size_changer', 'Option to change font size', 'access_spring_render_settings', $true_page, 'true_section_1', $true_field_params);
$true_field_params = array(
'type' => 'radio',
'id' => 'grayscale',
'vals' => array('true' => 'Enable', 'false' => 'Disable')
);
add_settings_field('grayscale', 'Option to set site grayscale', 'access_spring_render_settings', $true_page, 'true_section_1', $true_field_params);
$true_field_params = array(
'type' => 'radio',
'id' => 'sepia',
'vals' => array('true' => 'Enable', 'false' => 'Disable')
);
add_settings_field('sepia', 'Option to set site in sepia', 'access_spring_render_settings', $true_page, 'true_section_1', $true_field_params);
$true_field_params = array(
'type' => 'radio',
'id' => 'contrast',
'vals' => array('true' => 'Enable', 'false' => 'Disable')
);
add_settings_field('contrast', 'Option to change contrast', 'access_spring_render_settings', $true_page, 'true_section_1', $true_field_params);
$true_field_params = array(
'type' => 'radio',
'id' => 'invert',
'vals' => array('true' => 'Enable', 'false' => 'Disable')
);
add_settings_field('invert', 'Option to invert the colors', 'access_spring_render_settings', $true_page, 'true_section_1', $true_field_params);
$true_field_params = array(
'type' => 'radio',
'id' => 'custom_cursor',
'vals' => array('true' => 'Enable', 'false' => 'Disable')
);
add_settings_field('custom_cursor', 'Option to set the most contrast cursor', 'access_spring_render_settings', $true_page, 'true_section_1', $true_field_params);
$true_field_params = array(
'type' => 'radio',
'id' => 'highlight_links',
'vals' => array('true' => 'Enable', 'false' => 'Disable')
);
add_settings_field('highlight_links', 'Option to highlight links', 'access_spring_render_settings', $true_page, 'true_section_1', $true_field_params);
add_settings_section('true_section_2', 'Configure appearence', '', $true_page);
$true_field_params = array(
'type' => 'text',
'id' => 'background-color',
'desc' => 'Color must be provided in HEX, like a "#f4b3a5", or just "red", "blue" etc',
'label_for' => 'background-color'
);
add_settings_field('background-color_field', 'Background color of sidebar', 'access_spring_render_settings', $true_page, 'true_section_2', $true_field_params);
$true_field_params = array(
'type' => 'text',
'id' => 'button_color',
'desc' => 'Color must be provided in HEX, like a "#f4b3a5", or just "red", "blue" etc',
'label_for' => 'button_color'
);
add_settings_field('button_color_field', 'Color of buttons', 'access_spring_render_settings', $true_page, 'true_section_2', $true_field_params);
$true_field_params = array(
'type' => 'text',
'id' => 'text_color',
'desc' => 'Color must be provide in HEX, like a "#f4b3a5", or just "red", "blue" etc',
'label_for' => 'text_color'
);
add_settings_field('text_color_field', 'Color of text and labels', 'access_spring_render_settings', $true_page, 'true_section_2', $true_field_params);
$true_field_params = array(
'type' => 'text',
'id' => 'close_color',
'desc' => 'Color must be provide in HEX, like a "#f4b3a5", or just "red", "blue" etc',
'label_for' => 'close_color'
);
add_settings_field('close_color_field', 'Color of the close button', 'access_spring_render_settings', $true_page, 'true_section_2', $true_field_params);
$true_field_params = array(
'type' => 'radio',
'id' => 'choose_icon',
'vals' => array(
'one' => '
',
'two' => '
',
'three' => '
',
'four' => '
'
)
);
add_settings_field('choose_icon', 'Option to choose icon', 'access_spring_render_settings', $true_page, 'true_section_2', $true_field_params);
}
add_action('admin_init', 'access_spring_option_settings');
function access_spring_render_settings($args)
{
extract($args);
$option_name = 'true_options';
$o = get_option($option_name);
if(!$o) {
$o = [];
}
switch ($type) {
case 'text':
$o[$id] = isset($o[$id]) ? esc_attr(stripslashes($o[$id])) : '';
echo "";
echo ($desc != '') ? "
$desc" : "";
break;
case 'checkbox':
$checked = ($o[$id] == 'on') ? " checked='checked'" : '';
echo "";
break;
case 'file':
echo "";
break;
case 'radio':
echo "";
break;
}
}
function is_login_page(){
return strpos($_SERVER['REQUEST_URI'], 'wp-login') === 1;
}
if ( ! is_admin() && ! is_login_page() ) {
// Check if wp_body_open is being used by the theme
if ( has_action( 'wp_body_open' ) ) {
add_action( 'wp_body_open', 'as_render_sidebar' );
}
// If wp_body_open is not available, fallback to wp_footer
elseif ( has_action( 'wp_footer' ) ) {
add_action( 'wp_footer', 'as_render_sidebar' );
} else {
// If neither wp_body_open nor wp_footer are available, call the function directly
add_action( 'wp_head', 'as_render_sidebar' ); // Fallback: render in wp_head as last resort
}
}
?>