• Skip to main content
  • Skip to primary sidebar

Technical Notes Of
Ehi Kioya

Technical Notes Of Ehi Kioya

  • About
  • Contact
MENUMENU
  • Blog Home
  • AWS, Azure, Cloud
  • Backend (Server-Side)
  • Frontend (Client-Side)
  • SharePoint
  • Tools & Resources
    • CM/IN Ruler
    • URL Decoder
    • Text Hasher
    • Word Count
    • IP Lookup
  • Linux & Servers
  • Zero Code Tech
  • WordPress
  • Musings
  • More
    Categories
    • Cloud
    • Server-Side
    • Front-End
    • SharePoint
    • Tools
    • Linux
    • Zero Code
    • WordPress
    • Musings

Reply To: How To Change Or Remove The WordPress Login Error Message

November 20, 2019 at 7:13 pm #80886
Keymaster
@ehi-kioya

You should not use create_function(). Otherwise, while trying to close one potential security hole (too much information in WordPress login error messages), you may be inadvertently opening another, more dangerous security hole – the internal use of eval() inside the create_function() underlying code.

Instead, you need to rewrite the code that uses create_function() to use an anonymous function (aka closure) in its place. This article provides an example: Fix For “Function create_function() is deprecated” In PHP 7.2

So, in your above code, this line:

add_filter('login_errors', create_function('$a', "return 'Error: Incorrect login details. Try again';"));

Should be replaced with something like this:

add_filter('login_errors', function($a){ return 'Error: Incorrect login details. Try again'; });

I didn’t test my above code though. But I think it should work. Or at least, it should give any reader a guideline on how to avoid using create_function().

There’s more info about create_function() here.

Primary Sidebar

FORUM   MEMBERSHIP

Log In
Register Lost Password

POPULAR   FORUM   TOPICS

  • How to find the title of a song without knowing the lyrics
  • How To Change Or Remove The WordPress Login Error Message
  • The Art of Exploratory Data Analysis (Part 1)
  • Welcome Message
  • Replacing The Default SQLite Database With PostgreSQL In Django
  • Getting Started with SQL: A Beginners Guide to Databases
  • How to Implement Local SEO On Your Business Website And Drive Traffic
  • About
  • Contact

© 2022   ·   Ehi Kioya   ·   All Rights Reserved
Privacy Policy