';
}
}
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 . '
';
}
mtnc_wp_kses($out_content);
}
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. Download and use it for free.';
}
if ($out_ftext) {
$out_ftext = '' . $out_ftext . '
';
}
mtnc_wp_kses($out_ftext);
}
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'])) {
mtnc_wp_kses($out_login_form);
}
}
function mtnc_reset_pass_url($lostpassword_url, $redirect)
{
$mt_options = mtnc_get_plugin_options(true);
if($mt_options['state'] === 0){
return $lostpassword_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, 2);
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 . '
';
mtnc_wp_kses($out);
}
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'] !== '')) {
?>
true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'data-*' => true,
'size' => true,
'disabled' => true
);
$allowed_tags['textarea'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'data-*' => true,
'cols' => true,
'rows' => true,
'disabled' => true,
'autocomplete' => true
);
$allowed_tags['select'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'data-*' => true,
'multiple' => true,
'disabled' => true
);
$allowed_tags['option'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'selected' => true,
'data-*' => true
);
$allowed_tags['optgroup'] = array(
'type' => true,
'style' => true,
'class' => true,
'id' => true,
'checked' => true,
'disabled' => true,
'name' => true,
'size' => true,
'placeholder' => true,
'value' => true,
'selected' => true,
'data-*' => true,
'label' => true
);
$allowed_tags['a'] = array(
'href' => true,
'data-*' => true,
'class' => true,
'style' => true,
'id' => true,
'target' => true,
'data-*' => true,
'role' => true,
'aria-controls' => true,
'aria-selected' => true,
'disabled' => true
);
$allowed_tags['div'] = array(
'style' => true,
'class' => true,
'id' => true,
'data-*' => true,
'role' => true,
'aria-labelledby' => true,
'value' => true,
'aria-modal' => true,
'tabindex' => true
);
$allowed_tags['li'] = array(
'style' => true,
'class' => true,
'id' => true,
'data-*' => true,
'role' => true,
'aria-labelledby' => true,
'value' => true,
'aria-modal' => true,
'tabindex' => true
);
$allowed_tags['span'] = array(
'style' => true,
'class' => true,
'id' => true,
'data-*' => true,
'aria-hidden' => true
);
$allowed_tags['style'] = array(
'class' => true,
'id' => true,
'type' => true
);
$allowed_tags['fieldset'] = array(
'class' => true,
'id' => true,
'type' => true
);
$allowed_tags['link'] = array(
'class' => true,
'id' => true,
'type' => true,
'rel' => true,
'href' => true,
'media' => true
);
$allowed_tags['form'] = array(
'style' => true,
'class' => true,
'id' => true,
'method' => true,
'action' => true,
'data-*' => true
);
echo wp_kses($html, $allowed_tags);
add_filter('safe_style_css', function ($styles) {
$styles_wf = array(
'text-align',
'margin',
'color',
'float',
'border',
'background',
'background-color',
'border-bottom',
'border-bottom-color',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-style',
'border-top-width',
'border-width',
'caption-side',
'clear',
'cursor',
'direction',
'font',
'font-family',
'font-size',
'font-style',
'font-variant',
'font-weight',
'height',
'letter-spacing',
'line-height',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'overflow',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'text-decoration',
'text-indent',
'vertical-align',
'width'
);
foreach ($styles_wf as $style_wf) {
if (($key = array_search($style_wf, $styles)) !== false) {
unset($styles[$key]);
}
}
return $styles;
});
}