Change Login Appearance
function custom_login_background() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
function custom_login_background() { ?>Continue reading
function custom_login_logo() { // Replace with your actual logo URL $logo_url = ‘https://yourdomain.com/path-to-your-logo.png’; // Replace with your actual site URL $site_url = home_url(); echo ‘ ‘; } add_action( ‘login_enqueue_scripts’, ‘custom_login_logo’ ); function custom_login_logo_url() { return home_url(); // Replace with custom…Continue reading
add_action(‘login_head’, ‘remove_remember_me’); function remove_remember_me() { echo ‘ ‘; }Continue reading
// Disable Password Reset Functionality function disable_password_reset() { return false; } add_filter(‘allow_password_reset’, ‘disable_password_reset’); // Remove “Lost Your Password?” Link function remove_lostpassword_text($text) { if ($text == ‘Lost your password?’) { $text = ”; } return $text; } add_filter(‘gettext’, ‘remove_lostpassword_text’); // Block…Continue reading
function restrict_dashboard_access() { // Allow AJAX requests to proceed if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) { return; } // Check if user is not an administrator if ( ! current_user_can( ‘administrator’ ) && is_admin() ) { wp_redirect( home_url()…Continue reading
class Protected_User { // Select capabilities from the default ‘Administrator’ role public function __construct() { add_filter(‘editable_roles’, array($this, ‘filter_editable_roles’)); add_filter(‘map_meta_cap’, array($this, ‘filter_map_meta_cap’), 10, 4); } // Remove ‘Administrator’ role if the current user is not a protected user public function filter_editable_roles($roles)…Continue reading
/** * Shane Cakes – Complete WooCommerce Account Dashboard (With Animated Delivery Bike Tracking) */ // 1. Keep default menu structure intact add_filter( ‘woocommerce_account_menu_items’, ‘shane_custom_my_account_menu_order’ ); function shane_custom_my_account_menu_order( $menu_links ) { return $menu_links; } // 2. Hook directly…Continue reading
use Elementor\Controls_Manager; use Elementor\Group_Control_Background; function add_background_and_overlay_to_layout_tab($element, $args) { // === NORMAL BACKGROUND === $element->start_controls_section( ‘custom_background_layout’, [ ‘label’ => __(‘Background (Layout Tab)’, ‘textdomain’), ‘tab’ => Controls_Manager::TAB_LAYOUT, ] ); $element->add_group_control( Group_Control_Background::get_type(), [ ‘name’ => ‘custom_background’, ‘label’ => __(‘Background’, ‘textdomain’), ‘types’ => [‘classic’,…Continue reading
/** * Protect Elementor Forms */ add_action( ‘elementor_pro/forms/validation/email’, function( $field, $record, $ajax_handler ) { // validate email format if ( ! is_email( $field[‘value’] ) ) { $ajax_handler->add_error( $field[‘id’], ‘Invalid Email address, it must be in the format [email protected]’ ); return;…Continue reading
// Prevent new plugin installations but allow updates to existing plugins add_filter(‘user_has_cap’, ‘prevent_plugin_installation_for_all_users’, 10, 4); function prevent_plugin_installation_for_all_users($allcaps, $cap, $args, $user) { // Prevent plugin installation for all users if (isset($args[0]) && $args[0] === ‘install_plugins’) { $allcaps[$cap[0]] = false; } //…Continue reading