Opened 8 years ago
Closed 6 years ago
#37620 closed defect (bug) (wontfix)
Give us a bit help, with IS_ADMIN and IS_LOGIN
Reported by: | tazotodua | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Login and Registration | Keywords: | |
Focuses: | Cc: |
Description
well, i had a ticket already opened, by was closed as dublicate.
however, it was not a duplicate..
what will WP loose, if you add this feature to core?
However, developers will have a great help...
now, i wish, that in wp-login.php, there was defined a variable like this:
define('WP_LOGIN_is_executed',true);
so, if that constant is defined, that means i am on wp-login page..
WHY? because 10000s of users use "hide-login-page" feature (i.e. iThemes security or other plugins), so URLs are no-longer example.com/wp-login.php
and pagenow
=='wp-login.php' returns false!
same for ID_ADMIN()... those plugins have feature to hide-admin-url, thus, wp-admin
are no longer accessible, that make is_admin()
to return false..
thus, WHAT ON EARTH, if you simply put:
define("WP_ADMIN_page_executed", true);
so, everyone will have a solution, with checking those constants, instead of URL comparisons and etc..
i am exhausting to quarrel with skeptics, who always say "why that's needed"...
ok, you dont need, but we NEED, so is that hard to update that?
thanks for understanding.
Change History (2)
#2
@
6 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Hi @tazotodua,
I appreciate your enthusiasm for this request. However, I also feel that this is not something that should be added to WordPress Core.
The is_admin()
function is not based on the page's URL, so if the URLs are changed by a plugin, is_admin()
should still return true
. Also, as @SergeyBiryukov noted on #19898, constants are not an acceptable way to check for context. They are not filterable and are hard to verify in unit tests (see #25669).
Previously: #19898, #37483.