17,214 reputation
22137
bio website
location England, United Kingdom
age 27
visits member for 4 years, 5 months
seen 1 hour ago

♥ Joy Division, Made In Britain, WordPress, Sunny Afternoons


1h
comment How to get the current plugin name?
You should put the define in your main plugin file myplugin/myplugin.php
1d
comment I'm trying to create security question field for my login page
Your code gets loaded first, but it hooks onto actions that fire later (that's the core principle of WordPress plugins). When the user field is empty, the filter you hook onto isn't fired, so your code doesn't run. Like I say, if you want a more global solution, you'll have to implement some extra hooks that handle different situations, which is why I suggest checking out wp-login.php to see exactly what's going on.
1d
comment Using Theme Customizer Built-In Sections
I would suggest you keep doing the comment method, and keep all your functions "namespaced" with your own unique project prefix. Like I say, we do it as a "failsafe" for people that won't bother - it's always better to have code consistency in your project. Here's the relevant discussion on meta.
1d
comment I'm trying to create security question field for my login page
Safe in what way? If you want a more rigid solution, check out wp-login.php (from line 768 as of 4.1.2) and see how WordPress handles the logic flow.
1d
comment Using Theme Customizer Built-In Sections
It also saves a lot of headache with copy-pasters who just dump it right in their project - if we start handing out code like generic_function_name it won't be long before they hit a redefine/namespace clash.
1d
comment Using Theme Customizer Built-In Sections
Haha, luckily not. If I'd created ~200k snippets for this site I'd be questioning my sanity. It's the ID of the question (check the URL), and it's a syntax that many authors here adopt (the idea being that there's always some reference back to the question if you find the code unedited in the wild).
1d
answered Using Theme Customizer Built-In Sections
1d
answered Where to place add_action when enqueueing?
1d
answered if user is admin display admin link and logout link else display logout only
1d
comment Formatting wordpress debug messages
Are you by chance using a server package like xampp on your Windows box? These tend to bundle a debug module like xdebug, which give you the "nice" error messages - you can install it on your linux box too, but this is way outside the scope of WPSE and you'll be better off asking on Server Fault
1d
comment Using Theme Customizer Built-In Sections
The other 4 features rely on your theme declaring support for them in your functions.php, hence why they're not currently visible. Check out this article for a little more information, the first comment also tips at how to remove them.
1d
comment I'm trying to create security question field for my login page
This is the only hook I could find for passing errors back to WordPress and prevent successful sign in. I would suggest adding a request type check, see edit.
1d
revised I'm trying to create security question field for my login page
added 68 characters in body
1d
reviewed Leave Closed Developing a Woocommerce functionality
1d
reviewed No Action Needed Wordpress JSON API - Prev Post / Next Post using Ajax
1d
answered I'm trying to create security question field for my login page
1d
answered REST alert when new Wordpress post is published or updated
1d
comment How to use meta query for greater than value in array?
With difficulty. Why not store each price as a separate entry under the same meta key, and then use a simple meta_query with WP_Query - way easier and far more efficient performance-wise.
1d
reviewed Close Visual Composer Front end editing - How do i redirect to a thank you page upon post save/publish?
1d
reviewed Close How to show a non-translated post in a translated page?