';
}
}
add_action('logo_box', 'mtnc_get_logo_box', 10);
function mtnc_get_content_section()
{
$mt_options = mtnc_get_plugin_options(true);
if (!empty($mt_options['body_font_subset'])) {
$current_subset = esc_attr($mt_options['body_font_subset']);
$font_weight = (string) ((int) $current_subset);
$font_style = str_replace($font_weight, '', $current_subset);
}
if (empty($font_style) || $font_style === 'regular') {
$font_style = 'normal';
}
if (empty($font_weight)) {
$font_weight = 'normal';
}
$out_content = null;
if (!empty($mt_options['heading'])) {
$out_content .= '' . wp_kses_post(stripslashes($mt_options['heading'])) . '
';
}
if (!empty($mt_options['description'])) {
$description_content = wpautop(wp_kses_post(stripslashes($mt_options['description'])), true);
$out_content .= '' . $description_content . '
';
} else {
$site_description = get_bloginfo('description');
$out_content .= '' . $site_description . '
';
}
echo $out_content; // phpcs:ignore WordPress.Security.EscapeOutput
}
add_action('content_section', 'mtnc_get_content_section', 10);
function mtnc_get_footer_section()
{
$mt_options = mtnc_get_plugin_options(true);
if (!empty($mt_options['body_font_subset'])) {
$current_subset = esc_attr($mt_options['body_font_subset']);
$font_weight = (string) ((int) $current_subset);
$font_style = str_replace($font_weight, '', $current_subset);
}
if (empty($font_style) || $font_style === 'regular') {
$font_style = 'normal';
}
if (empty($font_weight)) {
$font_weight = 'normal';
}
$out_ftext = '';
if (isset($mt_options['footer_text']) && !empty($mt_options['footer_text'])) {
$out_ftext .= wp_kses_post(stripslashes($mt_options['footer_text']));
}
if (!empty($mt_options['show_some_love'])) {
$out_ftext .= '
This site is using the free WP Maintenance plugin.';
}
if ($out_ftext) {
$out_ftext = '' . $out_ftext . '
';
}
echo $out_ftext; // phpcs:ignore WordPress.Security.EscapeOutput
}
add_action('footer_section', 'mtnc_get_footer_section', 10);
function mtnc_do_button_login_form($error = -1)
{
?>
';
$out_login_form .= '';
$out_login_form .= '' . $error . '';
$out_login_form .= '';
$out_login_form .= '';
$out_login_form .= '' . __('Lost Password', 'maintenance') . '';
$out_login_form .= '';
$out_login_form .= '';
$out_login_form .= wp_nonce_field('mtnc_login', 'mtnc_login_check');
$out_login_form .= '';
if (isset($mt_options['is_login'])) {
echo $out_login_form; // phpcs:ignore WordPress.Security.EscapeOutput
}
}
function mtnc_reset_pass_url()
{
$args = array('action' => 'lostpassword');
$lostpassword_url = add_query_arg($args, network_site_url('wp-login.php', 'login'));
return $lostpassword_url;
}
add_filter('lostpassword_url', 'mtnc_reset_pass_url', 999, 0);
function mtnc_get_preloader_element()
{
$mt_options = mtnc_get_plugin_options(true);
if (!empty($mt_options['preloader_img'])) {
$preloader_img = wp_get_attachment_image_src($mt_options['preloader_img'], 'full');
$preloader_img = !empty($preloader_img) ? $preloader_img[0] : false;
}
$preloader = !empty($preloader_img) ? '
' : '';
$out = '' . $preloader . '
';
echo $out; // phpcs:ignore WordPress.Security.EscapeOutput
}
add_action('before_content_section', 'mtnc_get_preloader_element', 5);
function mtnc_gg_analytics_code()
{
$mt_options = mtnc_get_plugin_options(true);
if (!isset($mt_options['503_enabled']) && isset($mt_options['gg_analytics_id']) && ($mt_options['gg_analytics_id'] !== '')) {
?>