Easy Google AdSense - v'.EASY_GOOGLE_ADSENSE_VERSION.'
';
echo '
'.wp_kses($link_text, $allowed_html_tags).'
';
$current = '';
$action = '';
if (isset($_GET['page'])) {
$current = sanitize_text_field($_GET['page']);
if (isset($_GET['action'])) {
$action = sanitize_text_field($_GET['action']);
$current .= "&action=" . $action;
}
}
$content = '';
$content .= '
';
foreach ($plugin_tabs as $location => $tabname) {
if ($current == $location) {
$class = ' nav-tab-active';
} else {
$class = '';
}
$content .= '' . $tabname . '';
}
$content .= '
';
$allowed_html_tags = array(
'a' => array(
'href' => array(),
'class' => array()
),
'h2' => array(
'href' => array(),
'class' => array()
)
);
echo wp_kses($content, $allowed_html_tags);
if(!empty($action))
{
switch($action)
{
case 'addons':
easy_google_adsense_display_addons();
break;
}
}
else
{
$this->general_settings();
}
echo '
';
}
function general_settings() {
if (isset($_POST['easy_google_adsense_update_settings'])) {
$nonce = sanitize_text_field($_REQUEST['_wpnonce']);
if (!wp_verify_nonce($nonce, 'easy_google_adsense_general_settings')) {
wp_die(__('Error! Nonce Security Check Failed! please save the general settings again.', 'easy-google-adsense'));
}
$publisher_id = '';
if(isset($_POST['ega_publisher_id']) && !empty($_POST['ega_publisher_id'])){
$publisher_id = sanitize_text_field($_POST['ega_publisher_id']);
}
$generate_ads_txt = (isset($_POST['ega_generate_ads_txt']) && $_POST['ega_generate_ads_txt'] == '1') ? '1' : '';
$no_ads_for_admins = (isset($_POST['ega_no_ads_for_admins']) && $_POST['ega_no_ads_for_admins'] == '1') ? '1' : '';
$options = array();
$options['publisher_id'] = $publisher_id;
$options['generate_ads_txt'] = $generate_ads_txt;
$options['no_ads_for_admins'] = $no_ads_for_admins;
$post = $_POST;
do_action('easy_google_adsense_general_settings_submitted', $post);
easy_google_adsense_update_option($options);
echo '