get_results("SELECT option_name,option_value FROM {$wpdb->prefix}atb_options;",OBJECT);
if($get_config){
foreach($get_config as $row):
if($row->option_name=='disable_visual_editor') $disable_visual_editor=$row->option_value;
if($row->option_name=='disable_visual_editor_role') $disable_visual_editor_role=explode(",",$row->option_value);
if($row->option_name=='disable_visual_editor_role_exclude') $disable_visual_editor_role_exclude=$row->option_value;
if($row->option_name=='disable_visual_editor_post') $disable_visual_editor_post=explode(",",$row->option_value);
if($row->option_name=='disable_visual_editor_post_exclude') $disable_visual_editor_post_exclude=$row->option_value;
if($row->option_name=='disable_heartbeat') $disable_heartbeat=$row->option_value;
if($row->option_name=='disable_heartbeat_pagetype') $disable_heartbeat_pagetype=explode(",",$row->option_value);
if($row->option_name=='disable_heartbeat_pagetype_exclude') $disable_heartbeat_pagetype_exclude=$row->option_value;
if($row->option_name=='disable_heartbeat_post') $disable_heartbeat_post=explode(",",$row->option_value);
if($row->option_name=='disable_heartbeat_post_exclude') $disable_heartbeat_post_exclude=$row->option_value;
if($row->option_name=='limit_revisions') $limit_revisions=$row->option_value;
if($row->option_name=='limit_revisions_count') $limit_revisions_count=$row->option_value;
if($row->option_name=='limit_revisions_post') $limit_revisions_post=explode(",",$row->option_value);
if($row->option_name=='limit_revisions_post_exclude') $limit_revisions_post_exclude=$row->option_value;
if($row->option_name=='limit_usereditor_role') $limit_usereditor_role=$row->option_value;
if($row->option_name=='limit_usereditor_role_role') $limit_usereditor_role_role=explode(",",$row->option_value);
if($row->option_name=='limit_usereditor_role_role_exclude') $limit_usereditor_role_role_exclude=$row->option_value;
if($row->option_name=='limit_usereditor_hiderole_role') {$limit_usereditor_hiderole_role=$row->option_value; $_SESSION["limit_usereditor_hiderole_role"]=$limit_usereditor_hiderole_role;}
if($row->option_name=='password_reset_link') $password_reset_link=$row->option_value;
if($row->option_name=='password_reset_link_role') $password_reset_link_role=explode(",",$row->option_value);
if($row->option_name=='password_reset_link_role_exclude') $password_reset_link_role_exclude=$row->option_value;
if($row->option_name=='disable_notices') $disable_notices=$row->option_value;
if($row->option_name=='disable_notices_role') $disable_notices_role=explode(",",$row->option_value);
if($row->option_name=='disable_notices_role_exclude') $disable_notices_role_exclude=$row->option_value;
if($row->option_name=='page_hit') $page_hit=$row->option_value;
if($row->option_name=='page_hit_role') $page_hit_role=explode(",",$row->option_value);
if($row->option_name=='page_hit_role_exclude') $page_hit_role_exclude=$row->option_value;
if($row->option_name=='editor_warning') $editor_warning=$row->option_value;
if($row->option_name=='editor_warning_role') $editor_warning_role=explode(",",$row->option_value);
if($row->option_name=='editor_warning_role_exclude') $editor_warning_role_exclude=$row->option_value;
if($row->option_name=='dual_auth') $dual_auth=$row->option_value;
if($row->option_name=='dual_auth_role') $dual_auth_role=explode(",",$row->option_value);
if($row->option_name=='dual_auth_role_exclude') $dual_auth_role_exclude=$row->option_value;
if($row->option_name=='disable_wpautop') $disable_wpautop=$row->option_value;
if($row->option_name=='disable_wpautop_post') $disable_wpautop_post=explode(",",$row->option_value);
if($row->option_name=='disable_wpautop_post_exclude') $disable_wpautop_post_exclude=$row->option_value;
endforeach;
// Get Post Type
$post_type='';
if(!empty($_GET['post'])) {
$post=get_post(intval($_GET['post']));
$post_type=$post->post_type;
}
if(empty($post_type) && !empty($_GET['post_type'])) $post_type=sanitize_text_field($_GET['post_type']);
// Capture Page Hits
if($page_hit==1) {
if(($page_hit_role_exclude==0 && (count(array_intersect($page_hit_role,$user_roles))>0 || in_array('*All',$page_hit_role,true)))
|| ($page_hit_role_exclude==1 && (count(array_intersect($page_hit_role,$user_roles))==0 || in_array('*All',$page_hit_role,true)))) {
atb_hit_page();
}
}
// Disable TinyMCE Visual Editor
if((atb_is_path('wp-admin/post.php?post=') || atb_is_path('wp-admin/post-new.php')) && $disable_visual_editor==1) {
if(($disable_visual_editor_role_exclude==0 && (count(array_intersect($disable_visual_editor_role,$user_roles))>0 || in_array('*All',$disable_visual_editor_role,true)))
|| ($disable_visual_editor_role_exclude==1 && (count(array_intersect($disable_visual_editor_role,$user_roles))==0 || in_array('*All',$disable_visual_editor_role,true)))) {
if(($disable_visual_editor_post_exclude==0 && (in_array($post_type,$disable_visual_editor_post,true) || in_array('*All',$disable_visual_editor_post,true)))
|| ($disable_visual_editor_post_exclude==1 && (!in_array($post_type,$disable_visual_editor_post,true) || in_array('*All',$disable_visual_editor_post,true)))) {
add_filter('user_can_richedit','__return_false');
}
}
}
// User New/Edit Screen
if((atb_is_path('wp-admin/user-new.php') || atb_is_path('wp-admin/user-edit.php')) && $limit_usereditor_role==1) {
if(($limit_usereditor_role_role_exclude==0 && (count(array_intersect($limit_usereditor_role_role,$user_roles))>0 || in_array('*All',$limit_usereditor_role_role,true)))
|| ($limit_usereditor_role_role_exclude==1 && (count(array_intersect($limit_usereditor_role_role,$user_roles))==0 || in_array('*All',$limit_usereditor_role_role,true)))) {
function atb_user() { ?>
0 || in_array('*All',$limit_usereditor_role_role,true)))
|| ($limit_usereditor_role_role_exclude==1 && (count(array_intersect($limit_usereditor_role_role,$user_roles))==0 || in_array('*All',$limit_usereditor_role_role,true)))) {
function atb_user_list() { ?>
0 || in_array('*All',$password_reset_link_role,true)))
|| ($password_reset_link_role_exclude==1 && (count(array_intersect($password_reset_link_role,$user_roles))==0 || in_array('*All',$password_reset_link_role,true)))) {
if(atb_is_path('wp-admin/user-edit.php')) {
function atb_user_reset() { ?>
0 || in_array('*All',$disable_notices_role,true)))
|| ($disable_notices_role_exclude==1 && (count(array_intersect($disable_notices_role,$user_roles))==0 || in_array('*All',$disable_notices_role,true)))) {
function remove_core_updates(){global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);}
add_filter('pre_site_transient_update_core','remove_core_updates');
add_filter('pre_site_transient_update_plugins','remove_core_updates');
add_filter('pre_site_transient_update_themes','remove_core_updates');
function atb_notices() { ?>alert('no_update_notification');";
}
}
// Stop WordPress Heartbeat on public pages
if($disable_heartbeat==1) {
if(($disable_heartbeat_pagetype_exclude==0 && (in_array('Admin',$disable_heartbeat_pagetype,true) || in_array('*All',$disable_heartbeat_pagetype,true)))
|| ($disable_heartbeat_pagetype_exclude==1 && (!in_array('Admin',$disable_heartbeat_pagetype,true) || !in_array('*All',$disable_heartbeat_pagetype,true)))) {
if(($disable_heartbeat_post_exclude==0 && (in_array($post_type,$disable_heartbeat_post,true) || in_array('*All',$disable_heartbeat_post,true)))
|| ($disable_heartbeat_post_exclude==1 && (!in_array($post_type,$disable_heartbeat_post,true) || in_array('*All',$disable_heartbeat_post,true)))) {
function atb_stop_heartbeat() {wp_deregister_script('heartbeat');}
add_action('init','atb_stop_heartbeat',1);
//echo "";
}
}
}
// Limit Post Revisions
if(atb_is_path('wp-admin/post.php?post=') && $limit_revisions==1) {
if(($limit_revisions_post_exclude==0 && (in_array($post_type,$limit_revisions_post,true) || in_array('*All',$limit_revisions_post,true)))
|| ($limit_revisions_post_exclude==1 && (!in_array($post_type,$limit_revisions_post,true) || in_array('*All',$limit_revisions_post,true)))) {
//echo "";
function atb_post_revisions($limit_revisions_count) {return $limit_revisions;}
add_filter('wp_revisions_to_keep','atb_post_revisions',10,2);
}
}
// Disable WPautop
if($disable_wpautop==1) {
if(($disable_wpautop_post_exclude==0 && (in_array($post_type,$disable_wpautop_post,true) || in_array('*All',$disable_wpautop_post,true)))
|| ($disable_wpautop_post_exclude==1 && (!in_array($post_type,$disable_wpautop_post,true) || in_array('*All',$disable_wpautop_post,true)))) {
remove_filter('the_content','wpautop');
remove_filter('the_excerpt','wpautop');
}
}
// Theme Editor Warning
if($editor_warning==1 && atb_is_path('wp-admin/theme-editor.php?file=') && atb_is_path('php&theme')) {
if(($editor_warning_role_exclude==0 && (count(array_intersect($editor_warning_role,$user_roles))>0 || in_array('*All',$editor_warning_role,true)))
|| ($editor_warning_role_exclude==1 && (count(array_intersect($editor_warning_role,$user_roles))==0 || in_array('*All',$editor_warning_role,true)))) {
function atb_editor() { ?>
0 || in_array('*All',$dual_auth_role,true)))
|| ($dual_auth_role_exclude==1 && (count(array_intersect($dual_auth_role,$user_roles))==0 || in_array('*All',$dual_auth_role,true)))) {
if(isset($_SESSION['atb_flag']) && atb_is_path('/wp-admin')) atb_email_token($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
}
}
} else add_action('admin_notices','atb_admin_notice');