[wp-trac] [WordPress Trac] #47394: Gutenberg doesn't respond is_admin on firing save_post action

WordPress Trac noreply at wordpress.org
Fri Mar 3 08:45:28 UTC 2023


#47394: Gutenberg doesn't respond is_admin on firing save_post action
--------------------------+----------------------
 Reporter:  SGr33n        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by bedas):

 Therefore, this is the community standard now?
 Maybe https://developer.wordpress.org/reference/functions/is_admin/ should
 be updated?

 I find it personally daunting that a CMS like WP has no method to check if
 you are moving around the admin area or the front end area of your
 website.
 It is a basic thing to check.

 For example, you might want to load a whole class in a plugin only in the
 admin area, but not in the front end (and I mean in the admin area, which
 does not have anything to do with AJAX calls or else, so is_admin anyway
 never was useful, but at least, one could work with it)

 As it stands now, is_admin became very much useless to check about
 anything.
 It may or may not return true or false, basically totally at random.

 Plugins typically load at init, so that would be way too early for the fix
 suggested above?

 Perhaps I miss some good new trick?

 Could we reopen this ticket at least as a feature request to implement a
 proper is_admin check, even if IMO it is more of a problem introduced by
 Gutenberg, rather than something that needs to be added as "feature"

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47394#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list