document.addEventListener("DOMContentLoaded", function(event) { if (document.getElementById("user_login")) { document.getElementById("user_login").placeholder = "'.__("Account", "foxtool").'"; } if (document.getElementById("user_pass")) { document.getElementById("user_pass").placeholder = "'.__("Password", "foxtool").'"; } if (document.getElementById("user_email")) { document.getElementById("user_email").placeholder = "'.__("Email", "foxtool").'"; } }) '; } add_action('login_head', 'foxtool_custom_login_scripts', 1); } # thay đổi chân trang admin wp if ( isset($foxtool_options['custom-foo1'])){ function foxtool_custom_admin_footer() { global $foxtool_options; if (!empty($foxtool_options['custom-foo11'])){ echo $foxtool_options['custom-foo11']; } } add_filter('admin_footer_text', 'foxtool_custom_admin_footer'); } # tắt những widget mặc định ở bảng tin function foxtool_remove_dashboard_widgets() { global $foxtool_options; if(isset($foxtool_options['custom-home1'])){ remove_meta_box('dashboard_right_now','dashboard', 'normal'); // Widget thống kê } if(isset($foxtool_options['custom-home2'])){ remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // Widget thông tin WordPress } if(isset($foxtool_options['custom-home3'])){ remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Widget tin nhanh } if(isset($foxtool_options['custom-home4'])){ remove_meta_box('dashboard_activity','dashboard', 'normal'); // Widget bài viết mới } if(isset($foxtool_options['custom-home5'])){ remove_action('welcome_panel','wp_welcome_panel'); // Widget chào mừng } if(isset($foxtool_options['custom-home6'])){ remove_meta_box('dashboard_site_health', 'dashboard', 'normal'); // Widget sức khỏe } } add_action('wp_dashboard_setup', 'foxtool_remove_dashboard_widgets'); # widget tuy chinh if (isset($foxtool_options['custom-wid1'])){ function foxtool_custom_welcome() { global $wp_meta_boxes, $foxtool_options; $widget_name = !empty($foxtool_options['custom-wid11']) ? $foxtool_options['custom-wid11'] : __('Welcome to Foxtool', 'foxtool'); wp_add_dashboard_widget('custom_help_widget', $widget_name, 'foxtool_widtit'); } function foxtool_widtit() { global $foxtool_options; ?>
get_login_geturl(); if (basename($_SERVER['REQUEST_URI'], '?' . $_SERVER['QUERY_STRING']) == $geturl) { wp_safe_redirect(home_url("wp-login.php?{$geturl}&redirect=false")); exit(); } } public function login_form_field() { ?> get_login_geturl(); if (isset($_POST['redirect_login']) && $_POST['redirect_login'] == $geturl) { return false; } if (strpos($_SERVER['REQUEST_URI'], 'action=logout') !== false) { check_admin_referer('log-out'); $user = wp_get_current_user(); wp_logout(); wp_safe_redirect(home_url(), 302); die; } if ((strpos($_SERVER['REQUEST_URI'], $geturl) === false) && (strpos($_SERVER['REQUEST_URI'], 'wp-admin') !== false) || (strpos($_SERVER['REQUEST_URI'], $geturl) === false) && (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') !== false)) { wp_safe_redirect(home_url(), 302); die(); } } } $foxtool_logins = new Foxtool_Logins(); } # thay đoi logo wordpress admin bar # ẩn logo if (isset($foxtool_options['custom-logbar1'])){ function foxtool_logo_admin_bar_remove() { global $wp_admin_bar; $wp_admin_bar->remove_menu('wp-logo'); } add_action('wp_before_admin_bar_render', 'foxtool_logo_admin_bar_remove', 0); } if (isset($foxtool_options['custom-logbar2'])){ // thay doi logo function foxtool_change_admin_logo() { global $foxtool_options; if(!empty($foxtool_options['custom-logbar21'])){ echo ''; } } add_action('wp_before_admin_bar_render', 'foxtool_change_admin_logo'); }